[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2] tools: add option to explicitly enable VirtFS in QEMU build



9pfs support has been a documented feature since Xen 4.9, but QEMU will
not be built with backend support unless VirtFS is enabled, which is
predicated on the libcap and libattr dev packages being installed. This is
not obvious to anyone intending to use 9pfs.

This patch adds an 'enable-9pfs' option to configure which, if specified,
will cause '--enable-virtfs' to be passed to QEMU's configure. This will
cause the dependency on libcap and libattr to be called out if the packages
are not in installed.

For completeness, specifying 'disable-9pfs' will cause '--disable-virtfs' to
be passed to QEMU's confgure and not specifying an option will keep the
previous behaviour of predicating VirtFS on whether the libcap and libattr
packages are installed.

NOTE: The shell script in configure might look odd, but it is coded for
      consistency with other similar logic blocks within the file.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Jan Beulich <jbeulich@xxxxxxxx>
Cc: Julien Grall <julien.grall@xxxxxxx>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: Tim Deegan <tim@xxxxxxx>
Cc: Wei Liu <wei.liu2@xxxxxxxxxx>

v2:
 - Add the configure option rather then enabling VirtFS in all Linux builds.
---
 config/Tools.mk.in |  1 +
 tools/Makefile     | 10 +++++++++-
 tools/configure    | 29 +++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 0964f6f9e9..bdba087af0 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -62,6 +62,7 @@ SYSTEMD_CFLAGS      := @SYSTEMD_CFLAGS@
 SYSTEMD_LIBS        := @SYSTEMD_LIBS@
 XEN_SYSTEMD_DIR     := @SYSTEMD_DIR@
 XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
+CONFIG_9PFS         := @ninepfs@
 
 LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@
 
diff --git a/tools/Makefile b/tools/Makefile
index 67977ad850..c903d6a63e 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -232,6 +232,13 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
        else \
                enable_trace_backend='' ; \
        fi ; \
+       if [ "$(CONFIG_9PFS)" = "y" ]; then \
+               virtfs='--enable-virtfs' ; \
+       elif [ "$(CONFIG_9PFS)" = "n" ]; then \
+               virtfs='--disable-virtfs' ; \
+       else \
+               virtfs='' ; \
+       fi ; \
        
PKG_CONFIG_PATH=$(XEN_ROOT)/tools/pkg-config$${PKG_CONFIG_PATH:+:$${PKG_CONFIG_PATH}}
 \
        $$source/configure --enable-xen --target-list=i386-softmmu \
                $(QEMU_XEN_ENABLE_DEBUG) \
@@ -279,7 +286,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
                --python=$(PYTHON) \
                $(CONFIG_QEMUU_EXTRA_ARGS) \
                --cpu=$(IOEMU_CPU_ARCH) \
-               $(IOEMU_CONFIGURE_CROSS); \
+               $(IOEMU_CONFIGURE_CROSS) \
+               $$virtfs; \
        $(MAKE) all
 
 subdir-install-qemu-xen-dir: subdir-all-qemu-xen-dir
diff --git a/tools/configure b/tools/configure
index 27c8d054ab..1ce5215456 100755
--- a/tools/configure
+++ b/tools/configure
@@ -711,6 +711,7 @@ ocamltools
 monitors
 githttp
 rpath
+ninepfs
 DEBUG_DIR
 XEN_DUMP_DIR
 XEN_PAGING_DIR
@@ -820,6 +821,7 @@ with_xenstored
 enable_systemd
 with_systemd
 with_systemd_modules_load
+enable_9pfs
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1500,6 +1502,8 @@ Optional Features:
   --disable-ipxe          Enable in-tree IPXE, (DEFAULT is on if rombios is
                           enabled, otherwise off, see also --with-system-ipxe)
   --enable-systemd        Enable systemd support (default is DISABLED)
+  --enable-9pfs           Explicitly enable 9pfs support in QEMU build
+                          (default is to defer to QEMU configure default)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -9799,6 +9803,31 @@ if test "x$systemd" = "xy"; then :
 
 fi
 
+
+
+# Check whether --enable-9pfs was given.
+if test "${enable_9pfs+set}" = set; then :
+  enableval=$enable_9pfs;
+fi
+
+
+if test "x$enable_9pfs" = "xno"; then :
+
+    ax_cv_9pfs="n"
+
+elif test "x$enable_9pfs" = "xyes"; then :
+
+    ax_cv_9pfs="y"
+
+elif test -z $ax_cv_9pfs; then :
+
+    ax_cv_9pfs=""
+
+fi
+ninepfs=$ax_cv_9pfs
+
+
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.