tests: PCI controller checks

Check if PCI bridges with duplicate indexes are rejected.
PCI root controllers with non-zero indexes or addresses should
also be rejected.
This commit is contained in:
Ján Tomko 2013-07-22 08:51:55 +02:00
parent 926055474d
commit e4f0a55e79
4 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,16 @@
<domain type='qemu'>
<name>fdr-br</name>
<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>
<controller type='pci' index='0' model='pci-root'/>
<controller type='pci' index='1' model='pci-bridge'/>
<controller type='pci' index='1' model='pci-bridge'/>
</devices>
</domain>

View File

@ -0,0 +1,16 @@
<domain type='qemu'>
<name>fdr-br</name>
<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>
<controller type='pci' index='0' model='pci-root'>
<address type='pci' domain='0' bus='0' slot='0' function='0'/>
</controller>
</devices>
</domain>

View File

@ -0,0 +1,14 @@
<domain type='qemu'>
<name>fdr-br</name>
<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>
<controller type='pci' index='7' model='pci-root'/>
</devices>
</domain>

View File

@ -1020,6 +1020,12 @@ mymain(void)
DO_TEST_PARSE_ERROR("pci-bridge-negative-index-invalid",
QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE);
DO_TEST_PARSE_ERROR("pci-bridge-duplicate-index",
QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE);
DO_TEST_PARSE_ERROR("pci-root-nonzero-index",
QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE);
DO_TEST_PARSE_ERROR("pci-root-address",
QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_PCI_BRIDGE);
virObjectUnref(driver.config);
virObjectUnref(driver.caps);