Patchwork [RFC,RDMA,support,v5:,01/12] ./configure with and without --enable-rdma

login
register
mail settings
Submitter mrhines@linux.vnet.ibm.com
Date April 9, 2013, 3:04 a.m.
Message ID <1365476681-31593-2-git-send-email-mrhines@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/234938/
State New
Headers show

Comments

mrhines@linux.vnet.ibm.com - April 9, 2013, 3:04 a.m.
From: "Michael R. Hines" <mrhines@us.ibm.com>


Signed-off-by: Michael R. Hines <mrhines@us.ibm.com>
---
 configure |   25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
Paolo Bonzini - April 9, 2013, 5:05 p.m.
Il 09/04/2013 05:04, mrhines@linux.vnet.ibm.com ha scritto:
> +if test "$rdma" = "yes" ; then
> +  cat > $TMPC <<EOF
> +#include <rdma/rdma_cma.h>
> +int main(void) { return 0; }
> +EOF
> +  rdma_libs="-lrdmacm -libverbs"
> +  if ! compile_prog "" "$rdma_libs" ; then
> +      feature_not_found "rdma"
> +  fi
> +    

Please enable this by default, or it will bitrot.

The test should be like this:

if test "$rdma" != "no" ; then
  cat > $TMPC << EOF
...
EOF
  rdma_libs="-lrdmacm -libverbs"
  if compile_prog "-Werror" "$rdma_libs" ; then
    rdma="yes"
    libs_softmmu="$libs_softmmu $rdma_libs"
  else
    if test "$rdma" = "yes" ; then
      feature_not_found "rdma"
    fi
    rdma="no"
  fi
fi


...

if test "$rdma" = "yes" ; then
  echo "CONFIG_RDMA=y" >> $config_host_mak
fi
mrhines@linux.vnet.ibm.com - April 9, 2013, 6:07 p.m.
Thanks for all the comments...... will implement......


On 04/09/2013 01:05 PM, Paolo Bonzini wrote:
> Il 09/04/2013 05:04, mrhines@linux.vnet.ibm.com ha scritto:
>> +if test "$rdma" = "yes" ; then
>> +  cat > $TMPC <<EOF
>> +#include <rdma/rdma_cma.h>
>> +int main(void) { return 0; }
>> +EOF
>> +  rdma_libs="-lrdmacm -libverbs"
>> +  if ! compile_prog "" "$rdma_libs" ; then
>> +      feature_not_found "rdma"
>> +  fi
>> +
> Please enable this by default, or it will bitrot.
>
> The test should be like this:
>
> if test "$rdma" != "no" ; then
>    cat > $TMPC << EOF
> ...
> EOF
>    rdma_libs="-lrdmacm -libverbs"
>    if compile_prog "-Werror" "$rdma_libs" ; then
>      rdma="yes"
>      libs_softmmu="$libs_softmmu $rdma_libs"
>    else
>      if test "$rdma" = "yes" ; then
>        feature_not_found "rdma"
>      fi
>      rdma="no"
>    fi
> fi
>
>
> ...
>
> if test "$rdma" = "yes" ; then
>    echo "CONFIG_RDMA=y" >> $config_host_mak
> fi
>

Patch

diff --git a/configure b/configure
index 3738de4..127a299 100755
--- a/configure
+++ b/configure
@@ -180,6 +180,7 @@  xfs=""
 
 vhost_net="no"
 kvm="no"
+rdma="no"
 gprof="no"
 debug_tcg="no"
 debug="no"
@@ -918,6 +919,10 @@  for opt do
   ;;
   --enable-gtk) gtk="yes"
   ;;
+  --enable-rdma) rdma="yes"
+  ;;
+  --disable-rdma) rdma="no"
+  ;;
   --with-gtkabi=*) gtkabi="$optarg"
   ;;
   --enable-tpm) tpm="yes"
@@ -1122,6 +1127,8 @@  echo "  --enable-bluez           enable bluez stack connectivity"
 echo "  --disable-slirp          disable SLIRP userspace network connectivity"
 echo "  --disable-kvm            disable KVM acceleration support"
 echo "  --enable-kvm             enable KVM acceleration support"
+echo "  --disable-rdma           disable RDMA-based migration support"
+echo "  --enable-rdma            enable RDMA-based migration support"
 echo "  --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)"
 echo "  --disable-nptl           disable usermode NPTL support"
 echo "  --enable-nptl            enable usermode NPTL support"
@@ -1767,6 +1774,18 @@  EOF
   libs_softmmu="$sdl_libs $libs_softmmu"
 fi
 
+if test "$rdma" = "yes" ; then
+  cat > $TMPC <<EOF
+#include <rdma/rdma_cma.h>
+int main(void) { return 0; }
+EOF
+  rdma_libs="-lrdmacm -libverbs"
+  if ! compile_prog "" "$rdma_libs" ; then
+      feature_not_found "rdma"
+  fi
+    
+fi
+
 ##########################################
 # VNC TLS/WS detection
 if test "$vnc" = "yes" -a \( "$vnc_tls" != "no" -o "$vnc_ws" != "no" \) ; then
@@ -3408,6 +3427,7 @@  echo "Linux AIO support $linux_aio"
 echo "ATTR/XATTR support $attr"
 echo "Install blobs     $blobs"
 echo "KVM support       $kvm"
+echo "RDMA support      $rdma"
 echo "TCG interpreter   $tcg_interpreter"
 echo "fdt support       $fdt"
 echo "preadv support    $preadv"
@@ -4377,6 +4397,11 @@  if [ "$pixman" = "internal" ]; then
   echo "config-host.h: subdir-pixman" >> $config_host_mak
 fi
 
+if test "$rdma" = "yes" ; then
+echo "CONFIG_RDMA=y" >> $config_host_mak
+echo "LIBS+=$rdma_libs" >> $config_host_mak
+fi
+
 # build tree in object directory in case the source is not in the current directory
 DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32"
 DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas"