tools/configure: add options to pass EXTRA_CLFAGS
PATCH 1/1 tools/configure: add options to pass EXTRA_CLFAGS
config/Tools.mk.in | 4 ++++ tools/Makefile | 2 ++ tools/blktap/drivers/Makefile | 2 ++ tools/blktap/lib/Makefile | 2 ++ tools/blktap2/Makefile | 2 ++ tools/blktap2/control/Makefile | 2 ++ tools/blktap2/drivers/Makefile | 2 ++ tools/blktap2/lvm/Makefile | 2 ++ tools/blktap2/vhd/Makefile | 2 ++ tools/blktap2/vhd/lib/Makefile | 2 ++ tools/configure.ac | 6 ++++++ tools/console/Makefile | 3 +++ tools/debugger/kdd/Makefile | 3 +++ tools/debugger/xenitp/Makefile | 2 ++ tools/flask/utils/Makefile | 2 ++ tools/libaio/src/Makefile | 3 +++ tools/libfsimage/Makefile | 2 ++ tools/libvchan/Makefile | 2 ++ tools/libxc/Makefile | 2 ++ tools/libxen/Makefile | 2 ++ tools/libxl/Makefile | 2 ++ tools/memshr/Makefile | 2 ++ tools/misc/Makefile | 2 ++ tools/misc/lomount/Makefile | 4 +++- tools/misc/nsplitd/Makefile | 2 ++ tools/pygrub/Makefile | 2 ++ tools/python/Makefile | 2 ++ tools/tests/Makefile | 3 +++ tools/tests/mce-test/tools/Makefile | 2 ++ tools/tests/mem-sharing/Makefile | 2 ++ tools/tests/xen-access/Makefile | 2 ++ tools/xcutils/Makefile | 2 ++ tools/xenbackendd/Makefile | 3 +++ tools/xenmon/Makefile | 3 +++ tools/xenpaging/Makefile | 2 ++ tools/xenpmd/Makefile | 2 ++ tools/xenstat/Makefile | 2 ++ tools/xenstat/libxenstat/Makefile | 2 ++ tools/xenstat/xentop/Makefile | 2 ++ tools/xenstore/Makefile | 2 ++ tools/xentrace/Makefile | 3 +++ 41 files changed, 96 insertions(+), 1 deletions(-)
# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1332960970 -7200
# Node ID bb6c07589982cd206f7397d58cc73ac2cdb00fd0 # Parent 1821c05638dfe76f36625f3555c8b3e9108180e0 tools/configure: add options to pass EXTRA_CLFAGS
Currently qemu-xen will be compiled with CFLAGS only if CFLAGS was already in the environment during make invocation. If CFLAGS is in environment then make will append all of the various flags specified in xen Makefiles to this environment variable, which is then used in qemu configure. Since qemu-xen is not ready for compiler flags like "-std=gnu99" compilation will fail. If CFLAGS is not in environment, then configure will use just "-O2 -g" because make does not export its own CFLAGS variable.
Quoted 1 line
From a distro perspective, it is required to build libraries and
binaries with certain global cflags (arbitrary gcc options). Up to the point when qemu-xen was imported it worked as expected by exporting CFLAGS before 'make tools'. Now qemu-upstream reuses these CFLAGS, but it cant deal with the result.
This patch extends configure to recognize three environment variables which will be written to config/Tools.mk so they will be reused with each make invocation:
EXTRA_CFLAGS_XEN_TOOLS= specifies CFLAGS for the tools build. EXTRA_CFLAGS_QEMU_TRADITIONAL= specifies CFLAGS for old qemu. EXTRA_CFLAGS_QEMU_XEN= specifies CFLAGS for new qemu.
The new feature can be used like this in a rpm xen.spec file:
env \
EXTRA_CFLAGS_XEN_TOOLS="${RPM_OPT_FLAGS}" \
EXTRA_CFLAGS_QEMU_TRADITIONAL="${RPM_OPT_FLAGS}" \
EXTRA_CFLAGS_QEMU_XEN="${RPM_OPT_FLAGS}" \
./configure \
--libdir=%{_libdir} \
--prefix=/usr
makev3:
- move EXTRA_CFLAGS_XEN_TOOLS from rules in tools/Rules.mk to every Makefile except firmware because it runs in guest context and can not deal with gcc options like -fstack-protector. This turns EXTRA_CFLAGS_XEN_TOOLS into a HOST_CFLAGS kind of thing.
v2:
- add new EXTRA_CFLAGS_XEN_TOOLS variable to config/Tools.mk.in instead of modifying CFLAGS in this file. Also remove include order change in tools/Rules.mk since its now not needed anymore
- add EXTRA_CFLAGS_XEN_TOOLS to all rules in tools/Rules.mk
- update help output in tools/configure.ac
config/Tools.mk.in +4 -0
@@ -22,6 +22,10 @@ PREPEND_LIB := @PREPEND_LIB@ APPEND_INCLUDES := @APPEND_INCLUDES@ APPEND_LIB := @APPEND_LIB@ +EXTRA_CFLAGS_XEN_TOOLS := @EXTRA_CFLAGS_XEN_TOOLS@ +EXTRA_CFLAGS_QEMU_TRADITIONAL := @EXTRA_CFLAGS_QEMU_TRADITIONAL@ +EXTRA_CFLAGS_QEMU_XEN := @EXTRA_CFLAGS_QEMU_XEN@ + # Download GIT repositories via HTTP or GIT's own protocol? # GIT's protocol is faster and more robust, when it works at all (firewalls # may block it). We make it the default, but if your GIT repository downloads
tools/Makefile +2 -0
@@ -122,6 +122,7 @@ subdir-all-qemu-xen-traditional-dir subd set -e; \ $(buildmakevars2shellvars); \ cd qemu-xen-traditional-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \ $(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \ $(MAKE) install
@@ -146,6 +147,7 @@ subdir-all-qemu-xen-dir subdir-install-q source=.; \ fi; \ cd qemu-xen-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_XEN)" \ $$source/configure --enable-xen --target-list=i386-softmmu \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \
tools/blktap/drivers/Makefile +2 -0
@@ -35,6 +35,8 @@ else AIOLIBS := -laio endif +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS_blktapctrl := $(MEMSHRLIBS) $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) -L../lib -lblktap -lrt -lm -lpthread LDLIBS_img := $(AIOLIBS) $(CRYPT_LIB) -lpthread -lz
tools/blktap/lib/Makefile +2 -0
@@ -19,6 +19,8 @@ CFLAGS += -fPIC # get asprintf(): CFLAGS += -D _GNU_SOURCE +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + OBJS = $(SRCS:.c=.o) OBJS_PIC = $(SRCS:.c=.opic) IBINS :=
tools/blktap2/Makefile +2 -0
@@ -2,6 +2,8 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS += $(LDLIBS_libxenctrl) SUBDIRS-y :=
tools/blktap2/control/Makefile +2 -0
@@ -16,6 +16,8 @@ CFLAGS += $(CFLAGS_libxenctrl CFLAGS += -D_GNU_SOURCE CFLAGS += -DTAPCTL +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + CTL_OBJS := tap-ctl-ipc.o CTL_OBJS += tap-ctl-list.o CTL_OBJS += tap-ctl-allocate.o
tools/blktap2/drivers/Makefile +2 -0
@@ -49,6 +49,8 @@ ifeq ($(VHD_STATIC),y) td-util: CFLAGS += -static endif +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + PORTABLE-OBJS-y := PORTABLE-OBJS-$(CONFIG_Linux) += blk_linux.o PORTABLE-OBJS-$(CONFIG_NetBSD) += blk_netbsd.o
tools/blktap2/lvm/Makefile +2 -0
@@ -15,6 +15,8 @@ ifeq ($(CONFIG_X86_64),y) CFLAGS += -fPIC endif +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LVM-OBJS := lvm-util.o all: build
tools/blktap2/vhd/Makefile +2 -0
@@ -21,6 +21,8 @@ ifeq ($(VHD_STATIC),y) CFLAGS += -static endif +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LIBS := -Llib -lvhd all: subdirs-all build
tools/blktap2/vhd/lib/Makefile +2 -0
@@ -19,6 +19,8 @@ CFLAGS += -D_GNU_SOURCE CFLAGS += -fPIC CFLAGS += -g +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + ifeq ($(CONFIG_Linux),y) LIBS := -luuid endif
tools/configure.ac +6 -0
@@ -55,6 +55,12 @@ AC_ARG_VAR([APPEND_INCLUDES], [List of include folders to append to CFLAGS (without -I)]) AC_ARG_VAR([APPEND_LIB], [List of library folders to append to LDFLAGS (without -L)]) +AC_ARG_VAR([EXTRA_CFLAGS_XEN_TOOLS], + [Extra CFLAGS to build Xen tools]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_TRADITIONAL], + [Extra CFLAGS to build qemu-xen-traditional]) +AC_ARG_VAR([EXTRA_CFLAGS_QEMU_XEN], + [Extra CFLAGS to build qemu-xen-upstream]) AX_SET_FLAGS
tools/console/Makefile +3 -0
@@ -5,6 +5,9 @@ CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_libxenstore) + +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS += $(LDLIBS_libxenctrl) LDLIBS += $(LDLIBS_libxenstore) LDLIBS += $(SOCKET_LIBS)
tools/debugger/kdd/Makefile +3 -0
@@ -2,6 +2,9 @@ XEN_ROOT = $(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk CFLAGS += $(CFLAGS_libxenctrl) + +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS += $(LDLIBS_libxenctrl) CFILES := kdd.c kdd-xen.c
tools/debugger/xenitp/Makefile +2 -0
@@ -5,6 +5,8 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LIBBIN = ifeq ($(XEN_TARGET_ARCH),ia64)
tools/flask/utils/Makefile +2 -0
@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Wall -g -Werror CFLAGS += $(CFLAGS_libxenctrl) +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + TESTDIR = testsuite/tmp TESTFLAGS= -DTESTING TESTENV = XENSTORED_ROOTDIR=$(TESTDIR) XENSTORED_RUNDIR=$(TESTDIR)
tools/libaio/src/Makefile +3 -0
@@ -7,6 +7,9 @@ libdir=$(prefix)/lib ARCH := $(shell uname -m | sed -e s/i.86/i386/) CFLAGS = -nostdlib -nostartfiles -Wall -I. -g -fomit-frame-pointer -O2 -fPIC + +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + SO_CFLAGS=-shared $(CFLAGS) L_CFLAGS=$(CFLAGS) LINK_FLAGS=
tools/libfsimage/Makefile +2 -0
@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + SUBDIRS-y = common ufs reiserfs iso9660 fat zfs SUBDIRS-$(CONFIG_X86) += xfs ifeq ($(CONFIG_EXT2FS), y)
tools/libvchan/Makefile +2 -0
@@ -19,6 +19,8 @@ MINOR = 0 CFLAGS += -I../include -I. +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + .PHONY: all all: libxenvchan.so vchan-node1 vchan-node2 libxenvchan.a
tools/libxc/Makefile +2 -0
@@ -73,6 +73,8 @@ CFLAGS += -I. $(CFLAGS_xeninclude) # Needed for posix_fadvise64() in xc_linux.c CFLAGS-$(CONFIG_Linux) += -D_GNU_SOURCE +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + # Define this to make it possible to run valgrind on code linked with these # libraries. #CFLAGS += -DVALGRIND -O0 -ggdb3
tools/libxen/Makefile +2 -0
@@ -26,6 +26,8 @@ CFLAGS += -Iinclude $(shell $(CURL_CONFIG) --cflags) \ -fPIC +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDFLAGS += $(shell $(XML2_CONFIG) --libs) \ $(shell $(CURL_CONFIG) --libs)
tools/libxl/Makefile +2 -0
@@ -72,6 +72,8 @@ testidl.c: libxl_types.idl gentest.py li $(PYTHON) gentest.py libxl_types.idl testidl.c.new mv testidl.c.new testidl.c +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + .PHONY: all all: $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \ $(AUTOSRCS) $(AUTOINCS)
tools/memshr/Makefile +2 -0
@@ -11,6 +11,8 @@ CFLAGS += -D_GNU_SOURCE CFLAGS += -fPIC CFLAGS += -g +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LIB-SRCS := interface.c LIB-SRCS += shm.c LIB-SRCS += bidir-daemon.c
tools/misc/Makefile +2 -0
@@ -30,6 +30,8 @@ INSTALL_SBIN := $(INSTALL_SBIN-y) # Include configure output (config.h) to headers search path CFLAGS += -I$(XEN_ROOT)/tools +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + .PHONY: all all: build
tools/misc/lomount/Makefile +3 -1
@@ -3,6 +3,8 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + .PHONY: all all: build
@@ -20,4 +22,4 @@ clean: lomount: lomount.o $(CC) $(CFLAGS) -o $@ $< --include $(DEPS) +-include $(DEPS)
tools/misc/nsplitd/Makefile +2 -0
@@ -1,6 +1,8 @@ XEN_ROOT := $(CURDIR)/../../.. include $(XEN_ROOT)/tools/Rules.mk +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + CFILES = $(wildcard *.c) HDRS = $(wildcard *.h)
tools/pygrub/Makefile +2 -0
@@ -2,6 +2,8 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + .PHONY: all all: build .PHONY: build
tools/python/Makefile +2 -0
@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + .PHONY: all all: build
tools/tests/Makefile +3 -0
@@ -2,6 +2,9 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk CFLAGS += $(CFLAGS_libxenctrl) + +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS += $(LDLIBS_libxenctrl) SUBDIRS-y :=
tools/tests/mce-test/tools/Makefile +2 -0
@@ -7,6 +7,8 @@ CFLAGS += $(CFLAGS_libxenguest) CFLAGS += $(CFLAGS_libxenstore) CFLAGS += $(CFLAGS_xeninclude) +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + .PHONY: all all: xen-mceinj
tools/tests/mem-sharing/Makefile +2 -0
@@ -6,6 +6,8 @@ CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_xeninclude) +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + TARGETS-y := TARGETS-$(CONFIG_X86) += memshrtool TARGETS := $(TARGETS-y)
tools/tests/xen-access/Makefile +2 -0
@@ -7,6 +7,8 @@ CFLAGS += $(CFLAGS_libxenctrl) CFLAGS += $(CFLAGS_libxenguest) CFLAGS += $(CFLAGS_xeninclude) +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + TARGETS-y := TARGETS-$(CONFIG_X86) += xen-access TARGETS := $(TARGETS-y)
tools/xcutils/Makefile +2 -0
@@ -15,6 +15,8 @@ PROGRAMS = xc_restore xc_save readnotes CFLAGS += -Werror +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + CFLAGS_xc_restore.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) CFLAGS_xc_save.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) CFLAGS_readnotes.o := $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
tools/xenbackendd/Makefile +3 -0
@@ -14,6 +14,9 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenstore) + +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + CPPFLAGS += -DXEN_SCRIPT_DIR="\"$(XEN_SCRIPT_DIR)\"" LDLIBS += $(LDLIBS_libxenstore)
tools/xenmon/Makefile +3 -0
@@ -15,6 +15,9 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) + +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS += $(LDLIBS_libxenctrl) SCRIPTS = xenmon.py
tools/xenpaging/Makefile +2 -0
@@ -14,6 +14,8 @@ CFLAGS += -Werror CFLAGS += -Wno-unused CFLAGS += -g +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + OBJS = $(SRCS:.c=.o) IBINS = xenpaging
tools/xenpmd/Makefile +2 -0
@@ -4,6 +4,8 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenstore) +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS += $(LDLIBS_libxenstore) .PHONY: all
tools/xenstat/Makefile +2 -0
@@ -1,6 +1,8 @@ XEN_ROOT = $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + SUBDIRS := SUBDIRS += libxenstat
tools/xenstat/libxenstat/Makefile +2 -0
@@ -39,6 +39,8 @@ WARN_FLAGS=-Wall -Werror CFLAGS+=-fPIC CFLAGS+=-Isrc $(CFLAGS_libxenctrl) $(CFLAGS_libxenstore) $(CFLAGS_xeninclude) +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS-y = $(LDLIBS_libxenstore) $(LDLIBS_libxenctrl) LDLIBS-$(CONFIG_SunOS) += -lkstat
tools/xenstat/xentop/Makefile +2 -0
@@ -25,6 +25,8 @@ CFLAGS += -DHOST_$(XEN_OS) # Include configure output (config.h) to headers search path CFLAGS += -I$(XEN_ROOT)/tools +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + .PHONY: all all: xentop
tools/xenstore/Makefile +2 -0
@@ -52,6 +52,8 @@ xenstored_probes.o: xenstored_solaris.o CFLAGS += -DHAVE_DTRACE=1 endif +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + init-xenstore-domain.o: CFLAGS += $(CFLAGS_libxenguest) init-xenstore-domain: init-xenstore-domain.o $(LIBXENSTORE)
tools/xentrace/Makefile +3 -0
@@ -4,6 +4,9 @@ include $(XEN_ROOT)/tools/Rules.mk CFLAGS += -Werror CFLAGS += $(CFLAGS_libxenctrl) + +CFLAGS += $(EXTRA_CFLAGS_XEN_TOOLS) + LDLIBS += $(LDLIBS_libxenctrl) BIN = xentrace xentrace_setsize
PATCH 1/1 tools/configure: add options to pass EXTRA_CLFAGS
Olaf Hering writes ("[Xen-devel] [PATCH] tools/configure: add options to pass EXTRA_CLFAGS"):
Quoted 1 line
tools/configure: add options to passEXTRA_CLFAGS
Much of this looks good to me. (Although you need to fix the typo CLFLAGS in the subject...)
I'm happy with the changes to all the tools/*/Makefile.
Quoted 7 lines
This patch extends configure to recognize three environment variables which will be written to
config/Tools.mkso they will be reused with each make invocation:
EXTRA_CFLAGS_XEN_TOOLS= specifies CFLAGS for the tools build. EXTRA_CFLAGS_QEMU_TRADITIONAL= specifies CFLAGS for old qemu. EXTRA_CFLAGS_QEMU_XEN= specifies CFLAGS for new qemu.
The new feature can be used like this in a rpm xen.spec file:
I'm not sure why it is necessary to plumb these through our configure and Tools.mk. Why can't we just take them from the environment (or the make command line) ?
However,
tools/Makefile subdir-all-qemu-xen-traditional-dir subd · line 127
Quoted 4 lines
tools/Makefile +1
-0cd qemu-xen-traditional-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_TRADITIONAL)" \ $(QEMU_ROOT)/xen-setup $(IOEMU_CONFIGURE_CROSS); \ $(MAKE) install
I'm not really sure that this is a good idea. Note that the xen-setup script in qemu-xen-traditional already imports many of the settings from the Xen tree. I think this would be a better approach than a blanket export of CFLAGS.
tools/Makefile subdir-all-qemu-xen-dir subdir-install-q · line 153
Quoted 8 lines
tools/Makefile +1
-0@@ -146,6 +147,7 @@ subdir-all-qemu-xen-dir subdir-install-q source=.; \ fi; \ cd qemu-xen-dir; \ + env CFLAGS="$(EXTRA_CFLAGS_QEMU_XEN)" \ $$source/configure --enable-xen --target-list=i386-softmmu \ --source-path=$$source \ --extra-cflags="-I$(XEN_ROOT)/tools/include \
And this definitely isn't a good idea, unless you can find me some documentation from qemu upstream which says that it is a supported approach.
Thanks,
Ian.