提交 943f2d53 编写于 作者: A Andrea Bolognani

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: NAndrea Bolognani <abologna@redhat.com>
上级 83d86e34
...@@ -789,7 +789,6 @@ virQEMUCapsInitGuest(virCapsPtr caps, ...@@ -789,7 +789,6 @@ virQEMUCapsInitGuest(virCapsPtr caps,
ret = virQEMUCapsInitGuestFromBinary(caps, ret = virQEMUCapsInitGuestFromBinary(caps,
binary, qemubinCaps, binary, qemubinCaps,
NULL, NULL,
guestarch); guestarch);
VIR_FREE(binary); VIR_FREE(binary);
...@@ -802,8 +801,6 @@ int ...@@ -802,8 +801,6 @@ int
virQEMUCapsInitGuestFromBinary(virCapsPtr caps, virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
const char *binary, const char *binary,
virQEMUCapsPtr qemubinCaps, virQEMUCapsPtr qemubinCaps,
const char *kvmbin,
virQEMUCapsPtr kvmbinCaps,
virArch guestarch) virArch guestarch)
{ {
virCapsGuestPtr guest; virCapsGuestPtr guest;
...@@ -816,8 +813,7 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, ...@@ -816,8 +813,7 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
if (!binary) if (!binary)
return 0; return 0;
if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM) || if (virQEMUCapsGet(qemubinCaps, QEMU_CAPS_KVM))
kvmbin)
haskvm = true; haskvm = true;
if (virQEMUCapsGetMachineTypesCaps(qemubinCaps, &nmachines, &machines) < 0) if (virQEMUCapsGetMachineTypesCaps(qemubinCaps, &nmachines, &machines) < 0)
...@@ -863,21 +859,14 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, ...@@ -863,21 +859,14 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
if (haskvm) { if (haskvm) {
virCapsGuestDomainPtr dom; virCapsGuestDomainPtr dom;
if (kvmbin &&
virQEMUCapsGetMachineTypesCaps(kvmbinCaps, &nmachines, &machines) < 0)
goto cleanup;
if ((dom = virCapabilitiesAddGuestDomain(guest, if ((dom = virCapabilitiesAddGuestDomain(guest,
VIR_DOMAIN_VIRT_KVM, VIR_DOMAIN_VIRT_KVM,
kvmbin ? kvmbin : NULL,
NULL, NULL,
nmachines, NULL,
machines)) == NULL) { 0,
NULL)) == NULL) {
goto cleanup; goto cleanup;
} }
machines = NULL;
nmachines = 0;
} }
if ((ARCH_IS_X86(guestarch) || guestarch == VIR_ARCH_AARCH64) && if ((ARCH_IS_X86(guestarch) || guestarch == VIR_ARCH_AARCH64) &&
......
...@@ -612,8 +612,6 @@ const char *virQEMUCapsGetPreferredMachine(virQEMUCapsPtr qemuCaps); ...@@ -612,8 +612,6 @@ const char *virQEMUCapsGetPreferredMachine(virQEMUCapsPtr qemuCaps);
int virQEMUCapsInitGuestFromBinary(virCapsPtr caps, int virQEMUCapsInitGuestFromBinary(virCapsPtr caps,
const char *binary, const char *binary,
virQEMUCapsPtr qemubinCaps, virQEMUCapsPtr qemubinCaps,
const char *kvmbin,
virQEMUCapsPtr kvmbinCaps,
virArch guestarch); virArch guestarch);
int virQEMUCapsFillDomainCaps(virCapsPtr caps, int virQEMUCapsFillDomainCaps(virCapsPtr caps,
......
...@@ -106,8 +106,6 @@ testGetCaps(char *capsData, const testQemuData *data) ...@@ -106,8 +106,6 @@ testGetCaps(char *capsData, const testQemuData *data)
if (virQEMUCapsInitGuestFromBinary(caps, if (virQEMUCapsInitGuestFromBinary(caps,
binary, binary,
qemuCaps, qemuCaps,
NULL,
NULL,
arch) < 0) { arch) < 0) {
fprintf(stderr, "failed to create the capabilities from qemu"); fprintf(stderr, "failed to create the capabilities from qemu");
goto error; goto error;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册