mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 02:04:16 +03:00
qemu: Expect a single binary in virQEMUCapsInitGuest()
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 <abologna@redhat.com>
This commit is contained in:
parent
83d86e348e
commit
943f2d53c6
@ -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) &&
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user