We're only ever passing a single binary when calling this
function, so we can remove all code dealing with the
possibility of a second binary being specified.

Signed-off-by: Andrea Bolognani <abolo...@redhat.com>
---
 src/qemu/qemu_capabilities.c | 19 ++++---------------
 src/qemu/qemu_capabilities.h |  2 --
 tests/qemucaps2xmltest.c     |  2 --
 3 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 647fde4b6b..aa2de9018c 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -789,7 +789,6 @@ virQEMUCapsInitGuest(virCapsPtr caps,
 
     ret = virQEMUCapsInitGuestFromBinary(caps,
                                          binary, qemubinCaps,
-                                         NULL, NULL,
                                          guestarch);
 
     VIR_FREE(binary);
@@ -802,8 +801,6 @@ int
 virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
                                const char *binary,
                                virQEMUCapsPtr qemubinCaps,
-                               const char *kvmbin,
-                               virQEMUCapsPtr kvmbinCaps,
                                virArch guestarch)
 {
     virCapsGuestPtr guest;
@@ -816,8 +813,7 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
     if (!binary)
         return 0;
 
-    if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) ||
-        kvmbin)
+    if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM))
         haskvm = true;
 
     if (virQEMUCapsGetMachineTypesCaps(qemubinCaps, &nmachines, &machines) < 0)
@@ -863,21 +859,14 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
     if (haskvm) {
         virCapsGuestDomainPtr dom;
 
-        if (kvmbin &&
-            virQEMUCapsGetMachineTypesCaps(kvmbinCaps, &nmachines, &machines) 
< 0)
-            goto cleanup;
-
         if ((dom = virCapabilitiesAddGuestDomain(guest,
                                                  VIR_DOMAIN_VIRT_KVM,
-                                                 kvmbin ? kvmbin : NULL,
                                                  NULL,
-                                                 nmachines,
-                                                 machines)) == NULL) {
+                                                 NULL,
+                                                 0,
+                                                 NULL)) == NULL) {
             goto cleanup;
         }
-
-        machines = NULL;
-        nmachines = 0;
     }
 
     if ((ARCH_IS_X86(guestarch) || guestarch == VIR_ARCH_AARCH64) &&
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
index e671f74ebb..94b3bbb2f6 100644
--- a/src/qemu/qemu_capabilities.h
+++ b/src/qemu/qemu_capabilities.h
@@ -612,8 +612,6 @@ const char *virQEMUCapsGetPreferredMachine(virQEMUCapsPtr 
qemuCaps);
 int virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
                                    const char *binary,
                                    virQEMUCapsPtr qemubinCaps,
-                                   const char *kvmbin,
-                                   virQEMUCapsPtr kvmbinCaps,
                                    virArch guestarch);
 
 int virQEMUCapsFillDomainCaps(virCapsPtr caps,
diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c
index e765a03b73..883909a973 100644
--- a/tests/qemucaps2xmltest.c
+++ b/tests/qemucaps2xmltest.c
@@ -106,8 +106,6 @@ testGetCaps(char *capsData, const testQemuData *data)
     if (virQEMUCapsInitGuestFromBinary(caps,
                                        binary,
                                        qemuCaps,
-                                       NULL,
-                                       NULL,
                                        arch) < 0) {
         fprintf(stderr, "failed to create the capabilities from qemu");
         goto error;
-- 
2.17.1

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

Reply via email to