mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
qemu: Change tests to use (modified) qemuDomainAssignAddresses
Rewrote the device assignment parts in tests to use qemuDomainAssignAddresses. This way the tests will work for new device address types as they show up in the future (like s390 device types). Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
parent
f5dd58a608
commit
6e15887f30
@ -149,21 +149,11 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
goto out;
|
||||
|
||||
if (qemuCapsGet(extraFlags, QEMU_CAPS_DEVICE)) {
|
||||
qemuDomainPCIAddressSetPtr pciaddrs;
|
||||
|
||||
if (qemuDomainAssignSpaprVIOAddresses(vmdef)) {
|
||||
if (qemuDomainAssignAddresses(vmdef, extraFlags, NULL)) {
|
||||
if (expectError)
|
||||
goto ok;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!(pciaddrs = qemuDomainPCIAddressSetCreate(vmdef)))
|
||||
goto out;
|
||||
|
||||
if (qemuAssignDevicePCISlots(vmdef, pciaddrs) < 0)
|
||||
goto out;
|
||||
|
||||
qemuDomainPCIAddressSetFree(pciaddrs);
|
||||
}
|
||||
|
||||
log = virtTestLogContentAndReset();
|
||||
|
@ -95,17 +95,8 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
||||
if (qemudCanonicalizeMachine(&driver, vmdef) < 0)
|
||||
goto fail;
|
||||
|
||||
if (qemuCapsGet(extraFlags, QEMU_CAPS_DEVICE)) {
|
||||
qemuDomainPCIAddressSetPtr pciaddrs;
|
||||
if (!(pciaddrs = qemuDomainPCIAddressSetCreate(vmdef)))
|
||||
goto fail;
|
||||
|
||||
if (qemuAssignDevicePCISlots(vmdef, pciaddrs) < 0)
|
||||
goto fail;
|
||||
|
||||
qemuDomainPCIAddressSetFree(pciaddrs);
|
||||
}
|
||||
|
||||
if (qemuCapsGet(extraFlags, QEMU_CAPS_DEVICE))
|
||||
qemuDomainAssignAddresses(vmdef, extraFlags, NULL);
|
||||
|
||||
log = virtTestLogContentAndReset();
|
||||
VIR_FREE(log);
|
||||
|
Loading…
x
Reference in New Issue
Block a user