提交 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,
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册