From 6e15887f3044ea4e9c095437d3b556d49e6d09ef Mon Sep 17 00:00:00 2001 From: Viktor Mihajlovski Date: Fri, 29 Jun 2012 17:02:04 +0200 Subject: [PATCH] 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 --- tests/qemuxml2argvtest.c | 12 +----------- tests/qemuxmlnstest.c | 13 ++----------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7b00ea2e81..cda32b60b6 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -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(); diff --git a/tests/qemuxmlnstest.c b/tests/qemuxmlnstest.c index 8eca466fea..0bc821ddf3 100644 --- a/tests/qemuxmlnstest.c +++ b/tests/qemuxmlnstest.c @@ -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);