On 01/29/2013 09:52 AM, Stefan Berger wrote:
Add support for QEMU -add-fd command line parameter detection
---
src/qemu/qemu_capabilities.c | 3 +++
src/qemu/qemu_capabilities.h | 1 +
2 files changed, 4 insertions(+)
Index: libvirt/src/qemu/qemu_capabilities.c
===================================================================
--- libvirt.orig/src/qemu/qemu_capabilities.c
+++ libvirt/src/qemu/qemu_capabilities.c
@@ -203,6 +203,7 @@ VIR_ENUM_IMPL(qemuCaps, QEMU_CAPS_LAST,
"usb-serial", /* 125 */
"usb-net",
+ "add-fd"
Needs a trailing comma.
);
@@ -1064,6 +1065,8 @@ qemuCapsComputeCmdFlags(const char *help
qemuCapsSet(caps, QEMU_CAPS_SMBIOS_TYPE);
if (strstr(help, "-sandbox"))
qemuCapsSet(caps, QEMU_CAPS_SECCOMP_SANDBOX);
+ if (strstr(help, "-add-fd"))
+ qemuCapsSet(caps, QEMU_CAPS_ADD_FD);
Won't work the way you want. -add-fd wasn't supported until qemu 1.3,
but for qemu 1.2 and beyond, we only use QMP probing, not -help
scraping. So we really need to determine which QMP command we can issue
to determine whether -add-fd is available on the command line; but since
Anthony hasn't yet implemented 'query-config-schema'[1] (and even if he
does, it probably won't be in time for qemu 1.3), we'll have to settle
on version checks for now :(
[
1]https://www.redhat.com/archives/libvir-list/2013-January/msg01600.html
Index: libvirt/src/qemu/qemu_capabilities.h
===================================================================
--- libvirt.orig/src/qemu/qemu_capabilities.h
+++ libvirt/src/qemu/qemu_capabilities.h
@@ -165,6 +165,7 @@ enum qemuCapsFlags {
QEMU_CAPS_SCLP_S390 = 124, /* -device sclp* */
QEMU_CAPS_DEVICE_USB_SERIAL = 125, /* -device usb-serial */
QEMU_CAPS_DEVICE_USB_NET = 126, /* -device usb-net */
+ QEMU_CAPS_ADD_FD = 127, /* -add-fd */
Okay, so you are taking the approach that we insist on command line
support (qemu 1.3), not just the QMP command existing (qemu 1.2). It's
easy to probe whether 'add-fd' QMP exists (query-command), but harder to
determine if command line support is present when using just QMP with
the current state of qemu.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org