qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular
@ 2014-05-11 13:07 Michael Tokarev
  2014-05-13 13:04 ` Peter Lieven
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Tokarev @ 2014-05-11 13:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: Fam Zheng, Michael Tokarev, Peter Lieven

nfs block module uses libnfs and uses pkg-config to determine
its build information.  Somehow it used only --libs, not --cflags,
and added those libs into global $LIBS, instead of using per-object
variable.

Use both --libs and --cflags, use them as per-object variable,
and finally make block/nfs.o to be modular.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
---
 block/Makefile.objs |    2 ++
 configure           |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/block/Makefile.objs b/block/Makefile.objs
index fd88c03..38ddc0e 100644
--- a/block/Makefile.objs
+++ b/block/Makefile.objs
@@ -35,5 +35,7 @@ gluster.o-cflags   := $(GLUSTERFS_CFLAGS)
 gluster.o-libs     := $(GLUSTERFS_LIBS)
 ssh.o-cflags       := $(LIBSSH2_CFLAGS)
 ssh.o-libs         := $(LIBSSH2_LIBS)
+nfs.o-cflags       := $(LIBNFS_CFLAGS)
+nfs.o-libs         := $(LIBNFS_LIBS)
 qcow.o-libs        := -lz
 linux-aio.o-libs   := -laio
diff --git a/configure b/configure
index ac2fa15..3bc91f6 100755
--- a/configure
+++ b/configure
@@ -3928,7 +3928,7 @@ if test "$libnfs" != "no" ; then
   if $pkg_config --atleast-version=1.9.3 libnfs; then
     libnfs="yes"
     libnfs_libs=$($pkg_config --libs libnfs)
-    LIBS="$LIBS $libnfs_libs"
+    libnfs_cflags=$($pkg_config --cflags libnfs)
   else
     if test "$libnfs" = "yes" ; then
       feature_not_found "libnfs"
@@ -4534,7 +4534,9 @@ if test "$libiscsi" = "yes" ; then
 fi
 
 if test "$libnfs" = "yes" ; then
-  echo "CONFIG_LIBNFS=y" >> $config_host_mak
+  echo "CONFIG_LIBNFS=m" >> $config_host_mak
+  echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
+  echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
 fi
 
 if test "$seccomp" = "yes"; then
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular
  2014-05-11 13:07 [Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular Michael Tokarev
@ 2014-05-13 13:04 ` Peter Lieven
  2014-05-13 13:19   ` Fam Zheng
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Lieven @ 2014-05-13 13:04 UTC (permalink / raw)
  To: Michael Tokarev, qemu-devel; +Cc: Fam Zheng

On 11.05.2014 15:07, Michael Tokarev wrote:
> nfs block module uses libnfs and uses pkg-config to determine
> its build information.  Somehow it used only --libs, not --cflags,
> and added those libs into global $LIBS, instead of using per-object
> variable.

the missing cflags stuff was due to a bug in the libnfs.pc file.

https://github.com/sahlberg/libnfs/commit/d47c989d886e5398143d43d3b6d25fdf7210cb11

as there where no special flags I dropped it. this was before we realized
that we had to depend on a newer libnfs version anyway. thanks for spotting this.

>
> Use both --libs and --cflags, use them as per-object variable,
> and finally make block/nfs.o to be modular.

can you explain the modular stuff?

Thanks,
Peter

>
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
>   block/Makefile.objs |    2 ++
>   configure           |    6 ++++--
>   2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/block/Makefile.objs b/block/Makefile.objs
> index fd88c03..38ddc0e 100644
> --- a/block/Makefile.objs
> +++ b/block/Makefile.objs
> @@ -35,5 +35,7 @@ gluster.o-cflags   := $(GLUSTERFS_CFLAGS)
>   gluster.o-libs     := $(GLUSTERFS_LIBS)
>   ssh.o-cflags       := $(LIBSSH2_CFLAGS)
>   ssh.o-libs         := $(LIBSSH2_LIBS)
> +nfs.o-cflags       := $(LIBNFS_CFLAGS)
> +nfs.o-libs         := $(LIBNFS_LIBS)
>   qcow.o-libs        := -lz
>   linux-aio.o-libs   := -laio
> diff --git a/configure b/configure
> index ac2fa15..3bc91f6 100755
> --- a/configure
> +++ b/configure
> @@ -3928,7 +3928,7 @@ if test "$libnfs" != "no" ; then
>     if $pkg_config --atleast-version=1.9.3 libnfs; then
>       libnfs="yes"
>       libnfs_libs=$($pkg_config --libs libnfs)
> -    LIBS="$LIBS $libnfs_libs"
> +    libnfs_cflags=$($pkg_config --cflags libnfs)
>     else
>       if test "$libnfs" = "yes" ; then
>         feature_not_found "libnfs"
> @@ -4534,7 +4534,9 @@ if test "$libiscsi" = "yes" ; then
>   fi
>   
>   if test "$libnfs" = "yes" ; then
> -  echo "CONFIG_LIBNFS=y" >> $config_host_mak
> +  echo "CONFIG_LIBNFS=m" >> $config_host_mak
> +  echo "LIBNFS_CFLAGS=$libnfs_cflags" >> $config_host_mak
> +  echo "LIBNFS_LIBS=$libnfs_libs" >> $config_host_mak
>   fi
>   
>   if test "$seccomp" = "yes"; then

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular
  2014-05-13 13:04 ` Peter Lieven
@ 2014-05-13 13:19   ` Fam Zheng
  2014-05-13 13:35     ` Peter Lieven
  0 siblings, 1 reply; 5+ messages in thread
From: Fam Zheng @ 2014-05-13 13:19 UTC (permalink / raw)
  To: Peter Lieven; +Cc: Michael Tokarev, qemu-devel

On Tue, 05/13 15:04, Peter Lieven wrote:
> On 11.05.2014 15:07, Michael Tokarev wrote:
> >nfs block module uses libnfs and uses pkg-config to determine
> >its build information.  Somehow it used only --libs, not --cflags,
> >and added those libs into global $LIBS, instead of using per-object
> >variable.
> 
> the missing cflags stuff was due to a bug in the libnfs.pc file.
> 
> https://github.com/sahlberg/libnfs/commit/d47c989d886e5398143d43d3b6d25fdf7210cb11
> 
> as there where no special flags I dropped it. this was before we realized
> that we had to depend on a newer libnfs version anyway. thanks for spotting this.
> 
> >
> >Use both --libs and --cflags, use them as per-object variable,
> >and finally make block/nfs.o to be modular.
> 
> can you explain the modular stuff?

As what is possible with iscsi, gluster and curl now, with this change nfs.o is
possible to be built to a separate block-nfs.so, if configured as
--enable-modules, and loaded on program start.

Fam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular
  2014-05-13 13:19   ` Fam Zheng
@ 2014-05-13 13:35     ` Peter Lieven
  2014-05-13 14:15       ` Fam Zheng
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Lieven @ 2014-05-13 13:35 UTC (permalink / raw)
  To: Fam Zheng; +Cc: Michael Tokarev, qemu-devel

On 13.05.2014 15:19, Fam Zheng wrote:
> On Tue, 05/13 15:04, Peter Lieven wrote:
>> On 11.05.2014 15:07, Michael Tokarev wrote:
>>> nfs block module uses libnfs and uses pkg-config to determine
>>> its build information.  Somehow it used only --libs, not --cflags,
>>> and added those libs into global $LIBS, instead of using per-object
>>> variable.
>> the missing cflags stuff was due to a bug in the libnfs.pc file.
>>
>> https://github.com/sahlberg/libnfs/commit/d47c989d886e5398143d43d3b6d25fdf7210cb11
>>
>> as there where no special flags I dropped it. this was before we realized
>> that we had to depend on a newer libnfs version anyway. thanks for spotting this.
>>
>>> Use both --libs and --cflags, use them as per-object variable,
>>> and finally make block/nfs.o to be modular.
>> can you explain the modular stuff?
> As what is possible with iscsi, gluster and curl now, with this change nfs.o is
> possible to be built to a separate block-nfs.so, if configured as
> --enable-modules, and loaded on program start.

Aah okay. This is something new and not something I did wrong when the patch was submitted?

Peter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular
  2014-05-13 13:35     ` Peter Lieven
@ 2014-05-13 14:15       ` Fam Zheng
  0 siblings, 0 replies; 5+ messages in thread
From: Fam Zheng @ 2014-05-13 14:15 UTC (permalink / raw)
  To: Peter Lieven; +Cc: Michael Tokarev, qemu-devel

On Tue, 05/13 15:35, Peter Lieven wrote:
> On 13.05.2014 15:19, Fam Zheng wrote:
> >On Tue, 05/13 15:04, Peter Lieven wrote:
> >>On 11.05.2014 15:07, Michael Tokarev wrote:
> >>>nfs block module uses libnfs and uses pkg-config to determine
> >>>its build information.  Somehow it used only --libs, not --cflags,
> >>>and added those libs into global $LIBS, instead of using per-object
> >>>variable.
> >>the missing cflags stuff was due to a bug in the libnfs.pc file.
> >>
> >>https://github.com/sahlberg/libnfs/commit/d47c989d886e5398143d43d3b6d25fdf7210cb11
> >>
> >>as there where no special flags I dropped it. this was before we realized
> >>that we had to depend on a newer libnfs version anyway. thanks for spotting this.
> >>
> >>>Use both --libs and --cflags, use them as per-object variable,
> >>>and finally make block/nfs.o to be modular.
> >>can you explain the modular stuff?
> >As what is possible with iscsi, gluster and curl now, with this change nfs.o is
> >possible to be built to a separate block-nfs.so, if configured as
> >--enable-modules, and loaded on program start.
> 
> Aah okay. This is something new and not something I did wrong when the patch was submitted?

Absolutely.

Fam

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-13 14:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-11 13:07 [Qemu-devel] [PATCH] block/nfs: use per-object vars and make it modular Michael Tokarev
2014-05-13 13:04 ` Peter Lieven
2014-05-13 13:19   ` Fam Zheng
2014-05-13 13:35     ` Peter Lieven
2014-05-13 14:15       ` Fam Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).