All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [PATCH 15/18] virtfs: convert to meson
Date: Thu, 17 Dec 2020 10:40:41 +0100	[thread overview]
Message-ID: <20201217094044.46462-16-pbonzini@redhat.com> (raw)
In-Reply-To: <20201217094044.46462-1-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure         | 29 ++++-------------------------
 meson.build       | 24 ++++++++++++++++++++++--
 meson_options.txt | 11 +++++++----
 3 files changed, 33 insertions(+), 31 deletions(-)

diff --git a/configure b/configure
index 00c2d61a96..11d6f40f92 100755
--- a/configure
+++ b/configure
@@ -316,7 +316,7 @@ netmap="no"
 sdl="auto"
 sdl_image="auto"
 virtiofsd="auto"
-virtfs="$default_feature"
+virtfs="auto"
 libudev="auto"
 mpath="auto"
 vnc="enabled"
@@ -1005,9 +1005,9 @@ for opt do
   ;;
   --enable-qom-cast-debug) qom_cast_debug="yes"
   ;;
-  --disable-virtfs) virtfs="no"
+  --disable-virtfs) virtfs="disabled"
   ;;
-  --enable-virtfs) virtfs="yes"
+  --enable-virtfs) virtfs="enabled"
   ;;
   --disable-libudev) libudev="disabled"
   ;;
@@ -5445,24 +5445,6 @@ if [ "$eventfd" = "yes" ]; then
   ivshmem=yes
 fi
 
-if test "$softmmu" = yes ; then
-  if test "$linux" = yes; then
-    if test "$virtfs" != no && test "$cap_ng" = yes && test "$attr" = yes ; then
-      virtfs=yes
-    else
-      if test "$virtfs" = yes; then
-        error_exit "VirtFS requires libcap-ng devel and libattr devel"
-      fi
-      virtfs=no
-    fi
-  else
-    if test "$virtfs" = yes; then
-      error_exit "VirtFS is supported only on Linux"
-    fi
-    virtfs=no
-  fi
-fi
-
 # Probe for guest agent support/options
 
 if [ "$guest_agent" != "no" ]; then
@@ -5919,9 +5901,6 @@ fi
 if test "$libattr" = "yes" ; then
   echo "CONFIG_LIBATTR=y" >> $config_host_mak
 fi
-if test "$virtfs" = "yes" ; then
-  echo "CONFIG_VIRTFS=y" >> $config_host_mak
-fi
 if test "$vhost_scsi" = "yes" ; then
   echo "CONFIG_VHOST_SCSI=y" >> $config_host_mak
 fi
@@ -6582,7 +6561,7 @@ NINJA=$ninja $meson setup \
         -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \
         -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
         -Dlibssh=$libssh -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse \
-        -Dzstd=$zstd -Dseccomp=$seccomp \
+        -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs \
         -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
         -Dvhost_user_blk_server=$vhost_user_blk_server \
         -Dfuse=$fuse -Dfuse_lseek=$fuse_lseek \
diff --git a/meson.build b/meson.build
index a0132730d7..08d3586df5 100644
--- a/meson.build
+++ b/meson.build
@@ -959,6 +959,25 @@ endif
 # config-host.h #
 #################
 
+have_virtfs = (targetos == 'linux' and
+    have_system and
+    libattr.found() and
+    libcap_ng.found())
+
+if get_option('virtfs').enabled()
+  if not have_virtfs
+    if targetos != 'linux'
+      error('virtio-9p (virtfs) requires Linux')
+    elif not libcap_ng.found() or not libattr.found()
+      error('virtio-9p (virtfs) requires libcap-ng-devel and libattr-devel')
+    elif not have_system
+      error('virtio-9p (virtfs) needs system emulation support')
+    endif
+  endif
+elif get_option('virtfs').disabled()
+  have_virtfs = false
+endif
+
 config_host_data.set_quoted('CONFIG_BINDIR', get_option('prefix') / get_option('bindir'))
 config_host_data.set_quoted('CONFIG_PREFIX', get_option('prefix'))
 config_host_data.set_quoted('CONFIG_QEMU_CONFDIR', get_option('prefix') / qemu_confdir)
@@ -1001,6 +1020,7 @@ config_host_data.set('CONFIG_VNC', vnc.found())
 config_host_data.set('CONFIG_VNC_JPEG', jpeg.found())
 config_host_data.set('CONFIG_VNC_PNG', png.found())
 config_host_data.set('CONFIG_VNC_SASL', sasl.found())
+config_host_data.set('CONFIG_VIRTFS', have_virtfs)
 config_host_data.set('CONFIG_XKBCOMMON', xkbcommon.found())
 config_host_data.set('CONFIG_KEYUTILS', keyutils.found())
 config_host_data.set('CONFIG_GETTID', has_gettid)
@@ -1099,7 +1119,7 @@ host_kconfig = \
   ('CONFIG_VHOST_USER' in config_host ? ['CONFIG_VHOST_USER=y'] : []) + \
   ('CONFIG_VHOST_VDPA' in config_host ? ['CONFIG_VHOST_VDPA=y'] : []) + \
   ('CONFIG_VHOST_KERNEL' in config_host ? ['CONFIG_VHOST_KERNEL=y'] : []) + \
-  ('CONFIG_VIRTFS' in config_host ? ['CONFIG_VIRTFS=y'] : []) + \
+  (have_virtfs ? ['CONFIG_VIRTFS=y'] : []) + \
   ('CONFIG_LINUX' in config_host ? ['CONFIG_LINUX=y'] : []) + \
   ('CONFIG_PVRDMA' in config_host ? ['CONFIG_PVRDMA=y'] : [])
 
@@ -2287,7 +2307,7 @@ summary_info += {'mingw32 support':   targetos == 'windows'}
 summary_info += {'Audio drivers':     config_host['CONFIG_AUDIO_DRIVERS']}
 summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']}
 summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']}
-summary_info += {'VirtFS support':    config_host.has_key('CONFIG_VIRTFS')}
+summary_info += {'VirtFS support':    have_virtfs}
 summary_info += {'build virtiofs daemon': have_virtiofsd}
 summary_info += {'Multipath support': mpathpersist.found()}
 summary_info += {'VNC support':       vnc.found()}
diff --git a/meson_options.txt b/meson_options.txt
index 1854a9639f..59a8a50e5b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -90,10 +90,6 @@ option('vnc_sasl', type : 'feature', value : 'auto',
        description: 'SASL authentication for VNC server')
 option('xkbcommon', type : 'feature', value : 'auto',
        description: 'xkbcommon support')
-option('virtiofsd', type: 'feature', value: 'auto',
-       description: 'build virtiofs daemon (virtiofsd)')
-option('vhost_user_blk_server', type: 'feature', value: 'auto',
-       description: 'build vhost-user-blk server')
 option('zstd', type : 'feature', value : 'auto',
        description: 'zstd compression support')
 option('fuse', type: 'feature', value: 'auto',
@@ -101,6 +97,13 @@ option('fuse', type: 'feature', value: 'auto',
 option('fuse_lseek', type : 'feature', value : 'auto',
        description: 'SEEK_HOLE/SEEK_DATA support for FUSE exports')
 
+option('vhost_user_blk_server', type: 'feature', value: 'auto',
+       description: 'build vhost-user-blk server')
+option('virtfs', type: 'feature', value: 'auto',
+       description: 'virtio-9p support')
+option('virtiofsd', type: 'feature', value: 'auto',
+       description: 'build virtiofs daemon (virtiofsd)')
+
 option('capstone', type: 'combo', value: 'auto',
        choices: ['disabled', 'enabled', 'auto', 'system', 'internal'],
        description: 'Whether and how to find the capstone library')
-- 
2.29.2




  parent reply	other threads:[~2020-12-17  9:53 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17  9:40 [PATCH 00/22] meson: move detection of various libraries to meson.build Paolo Bonzini
2020-12-17  9:40 ` [PATCH 01/18] brlapi: convert to meson Paolo Bonzini
2020-12-17 11:35   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 02/18] curl: remove compatibility code, require 7.29.0 Paolo Bonzini
2020-12-17 10:08   ` Daniel P. Berrangé
2020-12-17 11:48   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 03/18] curl: convert to meson Paolo Bonzini
2020-12-17 10:11   ` Daniel P. Berrangé
2020-12-17 11:59   ` Marc-André Lureau
2020-12-17 12:00     ` Marc-André Lureau
2020-12-17 12:05       ` Paolo Bonzini
2020-12-17  9:40 ` [PATCH 04/18] glusterfs: " Paolo Bonzini
2020-12-17 12:15   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 05/18] bzip2: " Paolo Bonzini
2020-12-17 12:24   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 06/18] libiscsi: " Paolo Bonzini
2020-12-17 12:25   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 07/18] libnfs: " Paolo Bonzini
2020-12-17 12:26   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 08/18] libssh: " Paolo Bonzini
2020-12-17 12:35   ` Marc-André Lureau
2020-12-17 13:09     ` Paolo Bonzini
2020-12-17  9:40 ` [PATCH 09/18] rbd: " Paolo Bonzini
2020-12-17 12:36   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 10/18] lzo: " Paolo Bonzini
2020-12-17 12:42   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 11/18] snappy: " Paolo Bonzini
2020-12-17 12:47   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 12/18] lzfse: " Paolo Bonzini
2020-12-17 13:11   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 13/18] zstd: " Paolo Bonzini
2020-12-17 13:31   ` Marc-André Lureau
2020-12-17 13:32     ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 14/18] seccomp: " Paolo Bonzini
2020-12-17 13:36   ` Marc-André Lureau
2020-12-17  9:40 ` Paolo Bonzini [this message]
2020-12-17 13:38   ` [PATCH 15/18] virtfs: " Marc-André Lureau
2020-12-17  9:40 ` [PATCH 16/18] cap_ng: " Paolo Bonzini
2020-12-17 13:54   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 17/18] libattr: " Paolo Bonzini
2020-12-17 14:05   ` Marc-André Lureau
2020-12-17  9:40 ` [PATCH 18/18] meson.build: convert --with-default-devices " Paolo Bonzini
2020-12-17 14:08   ` Marc-André Lureau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201217094044.46462-16-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.