libvirt/tests/qemuxml2argvdata/qemuxml2argv-q35-multifunction.xml
Laine Stump 8f4008713a 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).)
2017-01-11 04:42:08 -05:00

52 lines
2.0 KiB
XML

<domain type='qemu'>
<name>q35-test</name>
<uuid>11dbdcdd-4c3b-482b-8903-9bdb8c0a2774</uuid>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='static' cpuset='0-1'>2</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<controller type='pci' model='pcie-root'/>
<controller type='pci' model='pcie-root-port'>
<address type='pci' slot='2' function='0'/>
</controller>
<controller type='pci' model='pcie-root-port'>
<address type='pci' slot='2' function='1'/>
</controller>
<controller type='pci' model='pcie-root-port'>
<address type='pci' slot='2' function='2'/>
</controller>
<controller type='pci' model='pcie-root-port'>
<address type='pci' slot='3' function='0'/>
</controller>
<controller type='pci' model='pcie-root-port'>
<address type='pci' slot='3' function='1' multifunction='on'/>
</controller>
<controller type='pci' model='pcie-root-port'>
<address type='pci' slot='4' function='0' multifunction='off'/>
</controller>
<controller type='pci' model='pcie-root-port'>
<address type='pci' slot='4' function='1'/>
</controller>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
<controller type='pci' model='pcie-root-port'/>
</devices>
</domain>