[PATCH] qemu: remove unused QEMU_CAPS_ENABLE_KVM

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

 



It needs for the -enable-kvm flag. This qemu flag can be compiled out,
but we already detect that case with the QEMU_CAPS_KVM check.
So this check is redundant and can be removed

Signed-off-by: Klim Kireev <klim.s.kireev@xxxxxxxxx>
---
 src/qemu/qemu_capabilities.c                       | 13 +------------
 src/qemu/qemu_capabilities.h                       |  2 +-
 src/qemu/qemu_command.c                            | 14 ++------------
 tests/qemucaps2xmldata/all_1.6.0-1.caps            |  2 +-
 tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps |  2 +-
 tests/qemuhelptest.c                               |  8 +++-----
 tests/qemuxml2argvdata/controller-order.args       |  1 -
 tests/qemuxml2argvdata/cpu-host-kvmclock.args      |  1 -
 tests/qemuxml2argvdata/cpu-kvmclock.args           |  1 -
 tests/qemuxml2argvtest.c                           | 11 +++++------
 10 files changed, 14 insertions(+), 41 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index b5eb8cf46..2a373d3a2 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1091,7 +1091,6 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
 
     if (virFileExists("/dev/kvm") &&
         (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) ||
-         virQEMUCapsGet(qemubinCaps, QEMU_CAPS_ENABLE_KVM) ||
          kvmbin))
         haskvm = true;
 
@@ -1260,7 +1259,7 @@ virQEMUCapsComputeCmdFlags(const char *help,
     if (strstr(help, "-no-kvm"))
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_KVM);
     if (strstr(help, "-enable-kvm"))
-        virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_KVM);
+        virQEMUCapsSet(qemuCaps, QEMU_CAPS_KVM);
     if (strstr(help, ",process="))
         virQEMUCapsSet(qemuCaps, QEMU_CAPS_NAME_PROCESS);
 
@@ -3201,7 +3200,6 @@ virQEMUCapsProbeQMPKVMState(virQEMUCapsPtr qemuCaps,
         virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM);
     } else if (!enabled) {
         virQEMUCapsClear(qemuCaps, QEMU_CAPS_KVM);
-        virQEMUCapsSet(qemuCaps, QEMU_CAPS_ENABLE_KVM);
     }
 
     return 0;
@@ -4388,15 +4386,6 @@ virQEMUCapsIsValid(void *data,
     kvmUsable = virFileAccessibleAs("/dev/kvm", R_OK | W_OK,
                                     priv->runUid, priv->runGid) == 0;
 
-    if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) &&
-        virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_KVM) &&
-        kvmUsable) {
-        VIR_DEBUG("KVM was not enabled when probing '%s', "
-                  "but it should be usable now",
-                  qemuCaps->binary);
-        return false;
-    }
-
     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM) &&
         !kvmUsable) {
         VIR_DEBUG("KVM was enabled when probing '%s', "
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index c2ec2be19..11a10b2f6 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -79,7 +79,7 @@ typedef enum {
     X_QEMU_CAPS_XEN_DOMID, /* -xen-domid */
     X_QEMU_CAPS_MIGRATE_QEMU_UNIX, /* qemu migration via unix sockets */
     X_QEMU_CAPS_CHARDEV, /* Is the new -chardev arg available */
-    QEMU_CAPS_ENABLE_KVM, /* -enable-kvm flag */
+    X_QEMU_CAPS_ENABLE_KVM, /* -enable-kvm flag */
     QEMU_CAPS_MONITOR_JSON, /* JSON mode for monitor */
 
     /* 25 */
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 9b1affd30..a68bf088e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6992,13 +6992,10 @@ qemuBuildObsoleteAccelArg(virCommandPtr cmd,
                           const virDomainDef *def,
                           virQEMUCapsPtr qemuCaps)
 {
-    bool disableKVM = false;
-    bool enableKVM = false;
-
     switch ((int)def->virtType) {
     case VIR_DOMAIN_VIRT_QEMU:
         if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM))
-            disableKVM = true;
+            virCommandAddArg(cmd, "-no-kvm");
         break;
 
     case VIR_DOMAIN_VIRT_KQEMU:
@@ -7007,9 +7004,7 @@ qemuBuildObsoleteAccelArg(virCommandPtr cmd,
         break;
 
     case VIR_DOMAIN_VIRT_KVM:
-        if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_KVM)) {
-            enableKVM = true;
-        } else if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) {
+        if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
                            _("the QEMU binary does not support kvm"));
             return -1;
@@ -7023,11 +7018,6 @@ qemuBuildObsoleteAccelArg(virCommandPtr cmd,
         return -1;
     }
 
-    if (disableKVM)
-        virCommandAddArg(cmd, "-no-kvm");
-    if (enableKVM)
-        virCommandAddArg(cmd, "-enable-kvm");
-
     return 0;
 }
 
diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.caps b/tests/qemucaps2xmldata/all_1.6.0-1.caps
index d39d0bebb..35b737a40 100644
--- a/tests/qemucaps2xmldata/all_1.6.0-1.caps
+++ b/tests/qemucaps2xmldata/all_1.6.0-1.caps
@@ -2,7 +2,7 @@
     <flag name='mem-path'/>
     <flag name='drive-serial'/>
     <flag name='chardev'/>
-    <flag name='enable-kvm'/>
+    <flag name='kvm'/>
     <flag name='monitor-json'/>
     <flag name='balloon'/>
     <flag name='device'/>
diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
index 5a0372c91..5e99e7d43 100644
--- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
+++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.caps
@@ -2,7 +2,7 @@
     <flag name='mem-path'/>
     <flag name='drive-serial'/>
     <flag name='chardev'/>
-    <flag name='enable-kvm'/>
+    <flag name='kvm'/>
     <flag name='monitor-json'/>
     <flag name='balloon'/>
     <flag name='device'/>
diff --git a/tests/qemuhelptest.c b/tests/qemuhelptest.c
index 1336eeef5..fb1998c84 100644
--- a/tests/qemuhelptest.c
+++ b/tests/qemuhelptest.c
@@ -147,7 +147,7 @@ mymain(void)
 
     DO_TEST("qemu-0.12.1", 12001, 0, 0,
             QEMU_CAPS_DRIVE_SERIAL,
-            QEMU_CAPS_ENABLE_KVM,
+            QEMU_CAPS_KVM,
             QEMU_CAPS_SDL,
             QEMU_CAPS_RTC,
             QEMU_CAPS_NO_HPET,
@@ -182,7 +182,6 @@ mymain(void)
             QEMU_CAPS_DRIVE_SERIAL,
             QEMU_CAPS_MEM_PATH,
             QEMU_CAPS_SDL,
-            QEMU_CAPS_ENABLE_KVM,
             QEMU_CAPS_RTC,
             QEMU_CAPS_NO_HPET,
             QEMU_CAPS_NO_KVM_PIT,
@@ -220,7 +219,6 @@ mymain(void)
             QEMU_CAPS_DRIVE_SERIAL,
             QEMU_CAPS_MEM_PATH,
             QEMU_CAPS_SDL,
-            QEMU_CAPS_ENABLE_KVM,
             QEMU_CAPS_MONITOR_JSON,
             QEMU_CAPS_NETDEV,
             QEMU_CAPS_RTC,
@@ -267,7 +265,7 @@ mymain(void)
             QEMU_CAPS_DRIVE_SERIAL,
             QEMU_CAPS_MEM_PATH,
             QEMU_CAPS_SDL,
-            QEMU_CAPS_ENABLE_KVM,
+            QEMU_CAPS_KVM,
             QEMU_CAPS_MONITOR_JSON,
             QEMU_CAPS_NETDEV,
             QEMU_CAPS_RTC,
@@ -338,7 +336,7 @@ mymain(void)
             QEMU_CAPS_DRIVE_SERIAL,
             QEMU_CAPS_MEM_PATH,
             QEMU_CAPS_SDL,
-            QEMU_CAPS_ENABLE_KVM,
+            QEMU_CAPS_KVM,
             QEMU_CAPS_MONITOR_JSON,
             QEMU_CAPS_NETDEV,
             QEMU_CAPS_RTC,
diff --git a/tests/qemuxml2argvdata/controller-order.args b/tests/qemuxml2argvdata/controller-order.args
index 70a8ba9ce..fea56cc05 100644
--- a/tests/qemuxml2argvdata/controller-order.args
+++ b/tests/qemuxml2argvdata/controller-order.args
@@ -8,7 +8,6 @@ QEMU_AUDIO_DRV=spice \
 -name fdr \
 -S \
 -M rhel6.1.0 \
--enable-kvm \
 -m 4096 \
 -smp 4,sockets=4,cores=1,threads=1 \
 -uuid d091ea82-29e6-2e34-3005-f02617b36e87 \
diff --git a/tests/qemuxml2argvdata/cpu-host-kvmclock.args b/tests/qemuxml2argvdata/cpu-host-kvmclock.args
index 1e45f0558..b82962b23 100644
--- a/tests/qemuxml2argvdata/cpu-host-kvmclock.args
+++ b/tests/qemuxml2argvdata/cpu-host-kvmclock.args
@@ -8,7 +8,6 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--enable-kvm \
 -cpu host,-kvmclock \
 -m 214 \
 -smp 6,sockets=6,cores=1,threads=1 \
diff --git a/tests/qemuxml2argvdata/cpu-kvmclock.args b/tests/qemuxml2argvdata/cpu-kvmclock.args
index 358b9be05..06a96ae4b 100644
--- a/tests/qemuxml2argvdata/cpu-kvmclock.args
+++ b/tests/qemuxml2argvdata/cpu-kvmclock.args
@@ -8,7 +8,6 @@ QEMU_AUDIO_DRV=none \
 -name QEMUGuest1 \
 -S \
 -M pc \
--enable-kvm \
 -cpu core2duo,-kvmclock \
 -m 214 \
 -smp 6,sockets=6,cores=1,threads=1 \
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 688846b9b..67836a936 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -796,16 +796,15 @@ mymain(void)
     DO_TEST("clock-france", QEMU_CAPS_RTC);
     DO_TEST("clock-hpet-off", QEMU_CAPS_RTC);
     DO_TEST("clock-catchup", QEMU_CAPS_RTC);
-    DO_TEST("cpu-kvmclock", QEMU_CAPS_ENABLE_KVM);
-    DO_TEST("cpu-host-kvmclock", QEMU_CAPS_ENABLE_KVM);
+    DO_TEST("cpu-kvmclock", QEMU_CAPS_KVM);
+    DO_TEST("cpu-host-kvmclock", QEMU_CAPS_KVM);
     DO_TEST("kvmclock", QEMU_CAPS_KVM);
     DO_TEST("clock-timer-hyperv-rtc", QEMU_CAPS_KVM);
 
-    DO_TEST("cpu-eoi-disabled", QEMU_CAPS_ENABLE_KVM);
-    DO_TEST("cpu-eoi-enabled", QEMU_CAPS_ENABLE_KVM);
+    DO_TEST("cpu-eoi-disabled", NONE);
+    DO_TEST("cpu-eoi-enabled", NONE);
     DO_TEST("controller-order",
             QEMU_CAPS_KVM,
-            QEMU_CAPS_ENABLE_KVM,
             QEMU_CAPS_BOOT_MENU,
             QEMU_CAPS_PIIX3_USB_UHCI,
             QEMU_CAPS_PCI_MULTIFUNCTION,
@@ -821,7 +820,7 @@ mymain(void)
     DO_TEST("eoi-enabled", NONE);
     DO_TEST("pv-spinlock-disabled", NONE);
     DO_TEST("pv-spinlock-enabled", NONE);
-    DO_TEST("kvmclock+eoi-disabled", QEMU_CAPS_ENABLE_KVM);
+    DO_TEST("kvmclock+eoi-disabled", NONE);
 
     DO_TEST("hyperv", NONE);
     DO_TEST("hyperv-off", NONE);
-- 
2.16.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]

  Powered by Linux