[PATCH] Fix netdev detection on RHEL6x versions of qemu

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

 



This allows the attach-device derived functions to work on the vanilla
RHEL6 versions of qemu. Looking for the '-spice' parameter differentiates
the RHEL from non-RHEL versions.

Signed-off-by: Neil Wilson <neil@xxxxxxxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c |    7 ++++---
 tests/qemuhelptest.c         |    2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 71a54a5..587de9e 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -962,10 +962,11 @@ qemuCapsComputeCmdFlags(const char *help,
         qemuCapsSet(flags, QEMU_CAPS_SMBIOS_TYPE);
 
     if (strstr(help, "-netdev")) {
-        /* Disable -netdev on 0.12 since although it exists,
-         * the corresponding netdev_add/remove monitor commands
+        /* Disable -netdev on non-RHEL6 versions of 0.12 since although
+         * it exists,the corresponding netdev_add/remove monitor commands
          * do not, and we need them to be able todo hotplug */
-        if (version >= 13000)
+        if ((version >= 13000) ||
+	   ((version >= 12001) && (strstr(help, "-spice"))))
             qemuCapsSet(flags, QEMU_CAPS_NETDEV);
     }
 
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 2522396..ceed35f 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -331,6 +331,7 @@ mymain(void)
             QEMU_CAPS_ENABLE_KVM,
             QEMU_CAPS_BALLOON,
             QEMU_CAPS_DEVICE,
+	    QEMU_CAPS_NETDEV,
             QEMU_CAPS_SMP_TOPOLOGY,
             QEMU_CAPS_RTC,
             QEMU_CAPS_VNET_HOST,
@@ -454,6 +455,7 @@ mymain(void)
             QEMU_CAPS_ENABLE_KVM,
             QEMU_CAPS_BALLOON,
             QEMU_CAPS_DEVICE,
+	    QEMU_CAPS_NETDEV,
             QEMU_CAPS_SMP_TOPOLOGY,
             QEMU_CAPS_RTC,
             QEMU_CAPS_VNET_HOST,
-- 
1.7.4.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]