]> xenbits.xensource.com Git - libvirt.git/commit
qemu: use virDomainPCIAddressSetAllMulti() to set multi when needed
authorLaine Stump <laine@laine.org>
Tue, 10 Jan 2017 05:20:11 +0000 (00:20 -0500)
committerLaine Stump <laine@laine.org>
Wed, 11 Jan 2017 09:42:08 +0000 (04:42 -0500)
commit8f4008713a49873b4bf354321f94b3fdeee14231
tree33f0be10b1b5fa2fa0e5d54e7e7cae4b25733e16
parent3c1a0fc27d271590818c672fab4dc935c6d2f21d
qemu: use virDomainPCIAddressSetAllMulti() to set multi when needed

If there are multiple devices assigned to the different functions of a
single PCI slot, they will not work properly if the device at function
0 doesn't have its "multi" attribute turned on, so it makes sense for
libvirt to turn it on during PCI address assignment. Setting multi
then assures that the new setting is stored in the config (so it will
be used next time the domain is started), preventing any potential
problems in the case that a future change in the configuration
eliminates the devices on all non-0 functions (multi will still be set
for function 0 even though it is the only function in use on the slot,
which has no useful purpose, but also doesn't cause any problems).

(NB: If we were to instead just decide on the setting for
multifunction at runtime, a later removal of the non-0 functions of a
slot would result in a silent change in the guest ABI for the
remaining device on function 0 (although it may seem like an
inconsequential guest ABI change, it *is* a guest ABI change to turn
off the multi bit).)
src/qemu/qemu_domain_address.c
tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.args [new file with mode: 0644]
tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/qemuxml2xmlout-q35-multifunction.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c