--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <!-- The default PHB (controller index 0) must have target index 0 -->
+ <controller type='pci' index='0' model='pci-root'>
+ <target index='1'/>
+ </controller>
+ <controller type='usb' model='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <!-- PHBs other than the default one can't have target index 0 -->
+ <controller type='pci' index='1' model='pci-root'>
+ <target index='0'/>
+ </controller>
+ <controller type='usb' model='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
--- /dev/null
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>524288</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <!-- QEMU only supports 32 PHBs with target index in the range 0-31,
+ so attempting to use target index 32 should fail -->
+ <controller type='pci' model='pci-root'>
+ <target index='32'/>
+ </controller>
+ <controller type='usb' model='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
+++ /dev/null
-<domain type='qemu'>
- <name>QEMUGuest1</name>
- <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
- <memory unit='KiB'>524288</memory>
- <vcpu placement='static'>1</vcpu>
- <os>
- <type arch='ppc64' machine='pseries'>hvm</type>
- </os>
- <devices>
- <emulator>/usr/bin/qemu-system-ppc64</emulator>
- <!-- The default PHB (controller index 0) must have target index 0 -->
- <controller type='pci' index='0' model='pci-root'>
- <target index='1'/>
- </controller>
- <!-- Other PHBs can't have target index 0 -->
- <controller type='pci' index='1' model='pci-root'>
- <target index='0'/>
- </controller>
- <controller type='usb' model='none'/>
- <memballoon model='none'/>
- </devices>
-</domain>
DO_TEST("pseries-phb-default-missing",
QEMU_CAPS_NODEFCONFIG,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE);
- DO_TEST_PARSE_ERROR("pseries-phb-wrong-target-index", NONE);
DO_TEST("pseries-phb-numa-node",
QEMU_CAPS_NUMA,
QEMU_CAPS_OBJECT_MEMORY_RAM,
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
QEMU_CAPS_SPAPR_PCI_HOST_BRIDGE_NUMA_NODE);
DO_TEST_PARSE_ERROR("pseries-default-phb-numa-node", NONE);
+ DO_TEST_PARSE_ERROR("pseries-phb-invalid-target-index-1", NONE);
+ DO_TEST_PARSE_ERROR("pseries-phb-invalid-target-index-2", NONE);
+ DO_TEST_PARSE_ERROR("pseries-phb-invalid-target-index-3", NONE);
DO_TEST("pseries-many-devices",
QEMU_CAPS_NODEFCONFIG,