Skip to contentSkip to conversation

buildsys: Move rdma libs to per object

PATCH In review Fam Zheng 5 participants 8 messages Sep 7, 2017 – Sep 8, 2017

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 buildsys: Move rdma libs to per object

---
 configure               | 2 +-
 migration/Makefile.objs | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
configure +1 -1
index fb7e34a901..470b8a085b 100755
@@ -2818,7 +2818,6 @@ EOF
   rdma_libs="-lrdmacm -libverbs"
   if compile_prog "" "$rdma_libs" ; then
     rdma="yes"
-    libs_softmmu="$libs_softmmu $rdma_libs"
   else
     if test "$rdma" = "yes" ; then
         error_exit \
@@ -6035,6 +6034,7 @@ echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
 
 if test "$rdma" = "yes" ; then
   echo "CONFIG_RDMA=y" >> $config_host_mak
+  echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
 fi
 
 if test "$have_rtnetlink" = "yes" ; then
migration/Makefile.objs +1 -0
index 1c7770da46..99e038024d 100644
@@ -11,3 +11,4 @@ common-obj-$(CONFIG_RDMA) += rdma.o
 
 common-obj-$(CONFIG_LIVE_BLOCK_MIGRATION) += block.o
 
+rdma.o-libs := $(RDMA_LIBS)
Signature · 1 line
2.13.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · * Fam Zheng ([email protected]) wrote:

OK, I've not actually got a preference as to whether it's per-object or not - I don't really see any advantage.

But since it doesn't look like it'll break it;

Quoted 37 lines
---
 configure               | 2 +-
 migration/Makefile.objs | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
configure +1 -1
index fb7e34a901..470b8a085b 100755
@@ -2818,7 +2818,6 @@ EOF
   rdma_libs="-lrdmacm -libverbs"
   if compile_prog "" "$rdma_libs" ; then
     rdma="yes"
-    libs_softmmu="$libs_softmmu $rdma_libs"
   else
     if test "$rdma" = "yes" ; then
         error_exit \
@@ -6035,6 +6034,7 @@ echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
 
 if test "$rdma" = "yes" ; then
   echo "CONFIG_RDMA=y" >> $config_host_mak
+  echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
 fi
 
 if test "$have_rtnetlink" = "yes" ; then
migration/Makefile.objs +1 -0
index 1c7770da46..99e038024d 100644
@@ -11,3 +11,4 @@ common-obj-$(CONFIG_RDMA) += rdma.o
 
 common-obj-$(CONFIG_LIVE_BLOCK_MIGRATION) += block.o
 
+rdma.o-libs := $(RDMA_LIBS)
Signature · 1 line
2.13.5

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 1/1
#5 lore raw
In reply to Fam Zheng
Quoted 1 line · Fam Zheng
Quoted 37 lines
---
 configure               | 2 +-
 migration/Makefile.objs | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
configure +1 -1
index fb7e34a901..470b8a085b 100755
@@ -2818,7 +2818,6 @@ EOF
   rdma_libs="-lrdmacm -libverbs"
   if compile_prog "" "$rdma_libs" ; then
     rdma="yes"
-    libs_softmmu="$libs_softmmu $rdma_libs"
   else
     if test "$rdma" = "yes" ; then
         error_exit \
@@ -6035,6 +6034,7 @@ echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
 
 if test "$rdma" = "yes" ; then
   echo "CONFIG_RDMA=y" >> $config_host_mak
+  echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
 fi
 
 if test "$have_rtnetlink" = "yes" ; then
migration/Makefile.objs +1 -0
index 1c7770da46..99e038024d 100644
@@ -11,3 +11,4 @@ common-obj-$(CONFIG_RDMA) += rdma.o
 
 common-obj-$(CONFIG_LIVE_BLOCK_MIGRATION) += block.o
 
+rdma.o-libs := $(RDMA_LIBS)
Signature · 1 line
2.13.5
Signature · 1 line
Peter Xu
author
#2 lore raw
In reply to Dr. David Alan Gilbert
Quoted 5 lines · Dr. David Alan Gilbert
Quoted 1 line · * Fam Zheng ([email protected]) wrote:

OK, I've not actually got a preference as to whether it's per-object or not - I don't really see any advantage.

Thanks for the review. You're right this probably doesn't make a difference except for a bit more consistency, until we want to make rdma a module (as in --enable-modules) like the ones in block layer. The -libs and -cflags variables were initially added just for that.

While we are talking about it, is there any reason why that will not be a good idea? There are other libraries used by QEMU outside block layer that are overdue to be converted to modules, like ui (gtk, sdl, etc.), rdma seems to be a candidate too.

Fam

#3 lore raw
Quoted 12 lines · * Fam Zheng ([email protected]) wrote:
Quoted 5 lines · Dr. David Alan Gilbert
Quoted 1 line · * Fam Zheng ([email protected]) wrote:

OK, I've not actually got a preference as to whether it's per-object or not - I don't really see any advantage.

Thanks for the review. You're right this probably doesn't make a difference except for a bit more consistency, until we want to make rdma a module (as in --enable-modules) like the ones in block layer. The -libs and -cflags variables were initially added just for that.

Quoted 4 lines

While we are talking about it, is there any reason why that will not be a good idea? There are other libraries used by QEMU outside block layer that are overdue to be converted to modules, like ui (gtk, sdl, etc.), rdma seems to be a candidate too.

I don't think we've ever tried to make the migration code modular; it probably wouldn't be impossible to split it out - it's wired into a few places but it should be doable.

Dave

Quoted 1 line

Fam

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK

Reviewed-by on v1 1/1
#6 lore raw
In reply to Fam Zheng
Quoted 1 line · Fam Zheng
Quoted 34 lines
---
 configure               | 2 +-
 migration/Makefile.objs | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
configure +1 -1
index fb7e34a901..470b8a085b 100755
@@ -2818,7 +2818,6 @@ EOF
   rdma_libs="-lrdmacm -libverbs"
   if compile_prog "" "$rdma_libs" ; then
     rdma="yes"
-    libs_softmmu="$libs_softmmu $rdma_libs"
   else
     if test "$rdma" = "yes" ; then
         error_exit \
@@ -6035,6 +6034,7 @@ echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
 
 if test "$rdma" = "yes" ; then
   echo "CONFIG_RDMA=y" >> $config_host_mak
+  echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
 fi
 
 if test "$have_rtnetlink" = "yes" ; then
migration/Makefile.objs +1 -0
index 1c7770da46..99e038024d 100644
@@ -11,3 +11,4 @@ common-obj-$(CONFIG_RDMA) += rdma.o
 
 common-obj-$(CONFIG_LIVE_BLOCK_MIGRATION) += block.o
 
+rdma.o-libs := $(RDMA_LIBS)
#4 lore raw
In reply to Fam Zheng
Quoted 12 lines · Fam Zheng
Quoted 5 lines · Dr. David Alan Gilbert
Quoted 1 line · * Fam Zheng ([email protected]) wrote:

OK, I've not actually got a preference as to whether it's per-object or not - I don't really see any advantage.

Thanks for the review. You're right this probably doesn't make a difference except for a bit more consistency, until we want to make rdma a module (as in --enable-modules) like the ones in block layer. The -libs and -cflags variables were initially added just for that.

Quoted 4 lines

While we are talking about it, is there any reason why that will not be a good idea? There are other libraries used by QEMU outside block layer that are overdue to be converted to modules, like ui (gtk, sdl, etc.), rdma seems to be a candidate too.

Since we have per-module flags, it makes sense to use them whereever it is reasonable todo so. The global flags should only be needed for things which are truely globally used, which is (almost) only glib2.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|