[PATCH 06/11] qemu: Remove unnecessary variables

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

 



Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index aa2de9018c..01be627af0 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -804,7 +804,6 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
                                virArch guestarch)
 {
     virCapsGuestPtr guest;
-    bool haskvm = false;
     virCapsGuestMachinePtr *machines = NULL;
     size_t nmachines = 0;
     int ret = -1;
@@ -813,9 +812,6 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
     if (!binary)
         return 0;
 
-    if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM))
-        haskvm = true;
-
     if (virQEMUCapsGetMachineTypesCaps(qemubinCaps, &nmachines, &machines) < 0)
         goto cleanup;
 
@@ -856,15 +852,13 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
                                       NULL) == NULL)
         goto cleanup;
 
-    if (haskvm) {
-        virCapsGuestDomainPtr dom;
-
-        if ((dom = virCapabilitiesAddGuestDomain(guest,
-                                                 VIR_DOMAIN_VIRT_KVM,
-                                                 NULL,
-                                                 NULL,
-                                                 0,
-                                                 NULL)) == NULL) {
+    if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM)) {
+        if (virCapabilitiesAddGuestDomain(guest,
+                                          VIR_DOMAIN_VIRT_KVM,
+                                          NULL,
+                                          NULL,
+                                          0,
+                                          NULL) == NULL) {
             goto cleanup;
         }
     }
-- 
2.17.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