libvirt/tests/qemuxml2argvdata/qemuxml2argv-pci-autofill-addr.xml
Laine Stump c026f8f1c2 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
2016-05-20 13:54:26 -04:00

36 lines
1008 B
XML

<domain type='qemu'>
<name>fdr-br</name>
<uuid>3ec6cbe1-b5a2-4515-b800-31a61855df41</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='pc-1.2'>hvm</type>
<boot dev='hd'/>
</os>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/var/iso/f18kde.iso'/>
<target dev='vda' bus='virtio'/>
<readonly/>
<address type='pci'/>
</disk>
<controller type='usb' index='0'>
<address type='pci'/>
</controller>
<controller type='ide' index='0'>
<address type='pci'/>
</controller>
<input type='mouse' bus='ps2'/>
<video>
<model type='cirrus' vram='16384' heads='1'/>
<address type='pci'/>
</video>
<memballoon model='virtio'>
<address type='pci'/>
</memballoon>
</devices>
</domain>