]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: auto-assign addresses when <address type='pci'/> is specified
authorLaine Stump <laine@laine.org>
Tue, 17 May 2016 18:08:13 +0000 (14:08 -0400)
committerLaine Stump <laine@laine.org>
Fri, 20 May 2016 17:54:26 +0000 (13:54 -0400)
commitc026f8f1c2cd079e98d001a13fcc6918c751d7ce
tree3a91af93619914447c4a55df61f17f97eaa97aab
parentd05da3fc7218b9f684de21414c3c5a6ede9000a8
qemu: auto-assign addresses when <address type='pci'/> is specified

Rather than only assigning a PCI address when no address is given at
all, also do it when the config says that the address type is 'pci',
but it gives no address (virDeviceInfoPCIAddressWanted()).

There are also several places after parsing but prior to address
assignment where code previously expected that any info with address
type='pci' would have a *valid* PCI address, which isn't always the
case - now we check not only for type='pci', but also for a valid
address (virDeviceInfoPCIAddressPresent()).

The test case added in this patch was directly copied from Cole's patch titled:

    qemu: Wire up address type=pci auto_allocate
src/conf/domain_addr.c
src/qemu/qemu_domain_address.c
tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autofill-addr.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c