From: Viktor Mihajlovski Date: Fri, 29 Jun 2012 15:02:04 +0000 (+0200) Subject: qemu: Change tests to use (modified) qemuDomainAssignAddresses X-Git-Tag: CVE-2012-3445~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6e15887f3044ea4e9c095437d3b556d49e6d09ef;p=thirdparty%2Flibvirt.git 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 --- 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);