Browse Source

meson: add virtfs-proxy-helper

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Marc-André Lureau 6 years ago
parent
commit
ec0d5893da
4 changed files with 19 additions and 4 deletions
  1. 0 2
      Makefile
  2. 5 2
      configure
  3. 8 0
      fsdev/meson.build
  4. 6 0
      meson.build

+ 0 - 2
Makefile

@@ -429,8 +429,6 @@ qemu-nbd$(EXESUF): qemu-nbd.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io
 qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
 qemu-io$(EXESUF): qemu-io.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
 qemu-storage-daemon$(EXESUF): qemu-storage-daemon.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(chardev-obj-y) $(io-obj-y) $(qom-obj-y) $(storage-daemon-obj-y) $(COMMON_LDADDS)
 qemu-storage-daemon$(EXESUF): qemu-storage-daemon.o $(authz-obj-y) $(block-obj-y) $(crypto-obj-y) $(chardev-obj-y) $(io-obj-y) $(qom-obj-y) $(storage-daemon-obj-y) $(COMMON_LDADDS)
 
 
-fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/9p-marshal.o fsdev/9p-iov-marshal.o $(COMMON_LDADDS)
-
 scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
 scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
 ifdef CONFIG_MPATH
 ifdef CONFIG_MPATH
 scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
 scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist

+ 5 - 2
configure

@@ -4388,6 +4388,7 @@ fi
 ##########################################
 ##########################################
 # attr probe
 # attr probe
 
 
+libattr_libs=
 if test "$attr" != "no" ; then
 if test "$attr" != "no" ; then
   cat > $TMPC <<EOF
   cat > $TMPC <<EOF
 #include <stdio.h>
 #include <stdio.h>
@@ -4404,7 +4405,8 @@ EOF
   # Older distros have <attr/xattr.h>, and need -lattr:
   # Older distros have <attr/xattr.h>, and need -lattr:
   elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then
   elif compile_prog "-DCONFIG_LIBATTR" "-lattr" ; then
     attr=yes
     attr=yes
-    LIBS="-lattr $LIBS"
+    libattr_libs="-lattr"
+    LIBS="$libattr_libs $LIBS"
     libattr=yes
     libattr=yes
   else
   else
     if test "$attr" = "yes" ; then
     if test "$attr" = "yes" ; then
@@ -6716,6 +6718,7 @@ if [ "$eventfd" = "yes" ]; then
 fi
 fi
 
 
 tools=""
 tools=""
+helpers=""
 if test "$want_tools" = "yes" ; then
 if test "$want_tools" = "yes" ; then
   tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
   tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
   if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
   if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
@@ -6726,7 +6729,6 @@ if test "$softmmu" = yes ; then
   if test "$linux" = yes; then
   if test "$linux" = yes; then
     if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
     if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
       virtfs=yes
       virtfs=yes
-      helpers="$helpers fsdev/virtfs-proxy-helper\$(EXESUF)"
     else
     else
       if test "$virtfs" = yes; then
       if test "$virtfs" = yes; then
         error_exit "VirtFS requires libcap-ng devel and libattr devel"
         error_exit "VirtFS requires libcap-ng devel and libattr devel"
@@ -7308,6 +7310,7 @@ if test "$linux_io_uring" = "yes" ; then
 fi
 fi
 if test "$attr" = "yes" ; then
 if test "$attr" = "yes" ; then
   echo "CONFIG_ATTR=y" >> $config_host_mak
   echo "CONFIG_ATTR=y" >> $config_host_mak
+  echo "LIBATTR_LIBS=$libattr_libs" >> $config_host_mak
 fi
 fi
 if test "$libattr" = "yes" ; then
 if test "$libattr" = "yes" ; then
   echo "CONFIG_LIBATTR=y" >> $config_host_mak
   echo "CONFIG_LIBATTR=y" >> $config_host_mak

+ 8 - 0
fsdev/meson.build

@@ -0,0 +1,8 @@
+have_virtfs_proxy_helper = have_tools and libattr.found() and libcap_ng.found() and 'CONFIG_VIRTFS' in config_host
+if have_virtfs_proxy_helper
+  executable('virtfs-proxy-helper',
+             files('virtfs-proxy-helper.c', '9p-marshal.c', '9p-iov-marshal.c'),
+             dependencies: [qemuutil, libattr, libcap_ng],
+             install: true,
+             install_dir: get_option('libexecdir'))
+endif

+ 6 - 0
meson.build

@@ -102,6 +102,10 @@ if 'CONFIG_GNUTLS' in config_host
 endif
 endif
 pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(),
 pixman = declare_dependency(compile_args: config_host['PIXMAN_CFLAGS'].split(),
                             link_args: config_host['PIXMAN_LIBS'].split())
                             link_args: config_host['PIXMAN_LIBS'].split())
+libattr = not_found
+if 'CONFIG_ATTR' in config_host
+  libattr = declare_dependency(link_args: config_host['LIBATTR_LIBS'].split())
+endif
 seccomp = not_found
 seccomp = not_found
 if 'CONFIG_SECCOMP' in config_host
 if 'CONFIG_SECCOMP' in config_host
   seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(),
   seccomp = declare_dependency(compile_args: config_host['SECCOMP_CFLAGS'].split(),
@@ -301,6 +305,8 @@ libqemuutil = static_library('qemuutil',
 qemuutil = declare_dependency(link_with: libqemuutil,
 qemuutil = declare_dependency(link_with: libqemuutil,
                               sources: genh + version_res)
                               sources: genh + version_res)
 
 
+subdir('fsdev')
+
 # Other build targets
 # Other build targets
 if 'CONFIG_GUEST_AGENT' in config_host
 if 'CONFIG_GUEST_AGENT' in config_host
   subdir('qga')
   subdir('qga')