diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 54757fcd26b3dc1cfc7e6af3b182738bf59a2e22..c4bad6f02eaa697881d895c44109274d79dc0b02 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -1104,7 +1104,8 @@ qemuCapsComputeCmdFlags(const char *help, if (strstr(help, "-netdev")) { /* Disable -netdev on 0.12 since although it exists, * the corresponding netdev_add/remove monitor commands - * do not, and we need them to be able todo hotplug */ + * do not, and we need them to be able to do hotplug. + * But see below about RHEL build. */ if (version >= 13000) qemuCapsSet(flags, QEMU_CAPS_NETDEV); } @@ -1169,12 +1170,20 @@ qemuCapsComputeCmdFlags(const char *help, /* While JSON mode was available in 0.12.0, it was too * incomplete to contemplate using. The 0.13.0 release * is good enough to use, even though it lacks one or - * two features. The benefits of JSON mode now outweigh - * the downside. + * two features. This is also true of versions of qemu + * built for RHEL, labeled 0.12.1, but with extra text + * in the help output that mentions that features were + * backported for libvirt. The benefits of JSON mode now + * outweigh the downside. */ #if HAVE_YAJL - if (version >= 13000) + if (version >= 13000) { qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON); + } else if (version >= 12000 && + strstr(help, "libvirt")) { + qemuCapsSet(flags, QEMU_CAPS_MONITOR_JSON); + qemuCapsSet(flags, QEMU_CAPS_NETDEV); + } #endif if (version >= 13000) diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c index 8802271d394c02fb83666e9757af0a45d8fe79cd..5ad55bc730b2a216d8b5c776d5249aa01ded617e 100644 --- a/tests/qemuhelptest.c +++ b/tests/qemuhelptest.c @@ -354,9 +354,11 @@ mymain(void) QEMU_CAPS_MIGRATE_QEMU_UNIX, QEMU_CAPS_CHARDEV, QEMU_CAPS_ENABLE_KVM, + QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_BALLOON, QEMU_CAPS_DEVICE, QEMU_CAPS_SMP_TOPOLOGY, + QEMU_CAPS_NETDEV, QEMU_CAPS_RTC, QEMU_CAPS_VHOST_NET, QEMU_CAPS_NO_KVM_PIT, @@ -503,9 +505,11 @@ mymain(void) QEMU_CAPS_MIGRATE_QEMU_UNIX, QEMU_CAPS_CHARDEV, QEMU_CAPS_ENABLE_KVM, + QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_BALLOON, QEMU_CAPS_DEVICE, QEMU_CAPS_SMP_TOPOLOGY, + QEMU_CAPS_NETDEV, QEMU_CAPS_RTC, QEMU_CAPS_VHOST_NET, QEMU_CAPS_NO_KVM_PIT, @@ -559,8 +563,10 @@ mymain(void) QEMU_CAPS_CHARDEV, QEMU_CAPS_ENABLE_KVM, QEMU_CAPS_BALLOON, + QEMU_CAPS_MONITOR_JSON, QEMU_CAPS_DEVICE, QEMU_CAPS_SMP_TOPOLOGY, + QEMU_CAPS_NETDEV, QEMU_CAPS_RTC, QEMU_CAPS_VHOST_NET, QEMU_CAPS_NO_KVM_PIT,