]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
tools: probe for existence of qemu-xen trace backends.
authorIan Campbell <ian.campbell@citrix.com>
Wed, 10 Feb 2016 12:35:59 +0000 (12:35 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 10 Feb 2016 12:45:23 +0000 (12:45 +0000)
QEMU upstream commit ed7f5f1d8db0 ("trace: convert stderr backend to
log") renamed the stderr trace backend to log, which breaks the xen
build when pointed at a QEMU tree after that point:

./configure of QEMU fail with:
"ERROR: invalid trace backends
        Please choose supported trace backends."

These changes are not (yet) present in qemu-xen-unstable.git and in
any case we want to support QEMU before and after this change. Use the
tracetool.py provided by QEMU to probe for supported trace backends.

This is now done unconditionally (not depending on debug=y), which is
simpler to arrange here but also follows upstream QEMU which in
baf86d6b3ca0 ("trace: switch default backend to "log"") switched the
default from "nop" to "log", so we would have got log in debug=no
builds from then on anyway.

Tested with current qemu-xen-unstable (f165e581d9a6) and current QEMU
upstream master (f075c89f0a9c), the latter picked up via:
    QEMU_UPSTREAM_URL := /path/to/qemu-xen.git
which therefore tested the out of tree build aspect of this change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>
tools/Makefile

index cb8652c79610433c65d4763b20e42fafd3efab0b..7556079961435e6a8c6d1b1f02bec974a9cbc32e 100644 (file)
@@ -228,7 +228,7 @@ qemu-xen-dir-force-update: qemu-xen-dir-find
        fi
 
 ifeq ($(debug),y)
-QEMU_XEN_ENABLE_DEBUG := --enable-debug --enable-trace-backend=stderr
+QEMU_XEN_ENABLE_DEBUG := --enable-debug
 else
 QEMU_XEN_ENABLE_DEBUG :=
 endif
@@ -240,8 +240,16 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
                source=.; \
        fi; \
        cd qemu-xen-dir; \
+       if $$source/scripts/tracetool.py --check-backends --backends log ; then \
+               enable_trace_backend='--enable-trace-backend=log'; \
+       elif $$source/scripts/tracetool.py --check-backends --backends stderr ; then \
+               enable_trace_backend='--enable-trace-backend=stderr'; \
+       else \
+               enable_trace_backend='' ; \
+       fi ; \
        $$source/configure --enable-xen --target-list=i386-softmmu \
                $(QEMU_XEN_ENABLE_DEBUG) \
+               $$enable_trace_backend \
                --prefix=$(LIBEXEC) \
                --libdir=$(LIBEXEC_LIB) \
                --includedir=$(LIBEXEC_INC) \