Since the nuances of PowerNV PHBs and root ports were already handled
when adding support for pnv-phb3* devices, we're already set to support
PowerNV9 PHBs and root ports as well.
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
.../powernv9-dupPHBs.ppc64-latest.err | 1 +
tests/qemuxml2argvdata/powernv9-dupPHBs.xml | 27 +++++++++++++
.../powernv9-root-port.ppc64-latest.args | 35 +++++++++++++++++
tests/qemuxml2argvdata/powernv9-root-port.xml | 17 ++++++++
tests/qemuxml2argvtest.c | 2 +
.../powernv9-root-port.ppc64-latest.xml | 39 +++++++++++++++++++
.../qemuxml2xmloutdata/powernv9-root-port.xml | 36 +++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
8 files changed, 158 insertions(+)
create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err
create mode 100644 tests/qemuxml2argvdata/powernv9-dupPHBs.xml
create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args
create mode 100644 tests/qemuxml2argvdata/powernv9-root-port.xml
create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/powernv9-root-port.xml
diff --git a/tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err
b/tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err
new file mode 100644
index 0000000000..bc5879640d
--- /dev/null
+++ b/tests/qemuxml2argvdata/powernv9-dupPHBs.ppc64-latest.err
@@ -0,0 +1 @@
+XML error: Multiple pnv-phb controllers with same chip-id and index
diff --git a/tests/qemuxml2argvdata/powernv9-dupPHBs.xml
b/tests/qemuxml2argvdata/powernv9-dupPHBs.xml
new file mode 100644
index 0000000000..49af69e6c4
--- /dev/null
+++ b/tests/qemuxml2argvdata/powernv9-dupPHBs.xml
@@ -0,0 +1,27 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='powernv9'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='pci' index='0' model='pcie-root'>
+ <model name='pnv-phb4'/>
+ <target index='0' chip-id='0'/>
+ </controller>
+ <controller type='pci' index='1' model='pcie-root'>
+ <model name='pnv-phb4'/>
+ <target index='1' chip-id='0'/>
+ </controller>
+ <controller type='pci' index='2' model='pcie-root'>
+ <model name='pnv-phb4'/>
+ <target index='1' chip-id='0'/>
+ </controller>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args
b/tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args
new file mode 100644
index 0000000000..007f425273
--- /dev/null
+++ b/tests/qemuxml2argvdata/powernv9-root-port.ppc64-latest.args
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+/usr/bin/qemu-system-ppc64 \
+-name guest=QEMUGuest1,debug-threads=on \
+-S \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tmp/lib/domain--1-QEMUGuest1/master-key.aes"}'
\
+-machine powernv9,usb=off,dump-guest-core=off,memory-backend=pnv.ram \
+-accel tcg \
+-cpu POWER9 \
+-m 2048 \
+-object
'{"qom-type":"memory-backend-ram","id":"pnv.ram","size":2147483648}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid b20fcfe3-4a0a-4039-8735-9e024256e0f7 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,fd=1729,server=on,wait=off \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-boot strict=on \
+-device
'{"driver":"pnv-phb4","index":0,"chip-id":0,"id":"pcie.0"}'
\
+-device
'{"driver":"pnv-phb4-root-port","port":0,"chassis":1,"id":"pci.1","bus":"pcie.0","addr":"0x0"}'
\
+-usb \
+-chardev pty,id=charserial0 \
+-device
'{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}'
\
+-audiodev
'{"id":"audio1","driver":"none"}' \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/powernv9-root-port.xml
b/tests/qemuxml2argvdata/powernv9-root-port.xml
new file mode 100644
index 0000000000..dfd74446f9
--- /dev/null
+++ b/tests/qemuxml2argvdata/powernv9-root-port.xml
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='powernv9'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1'
model='pcie-root-port'/>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 82e8b4482f..d445ec9871 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -2179,6 +2179,8 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64");
DO_TEST_CAPS_ARCH_LATEST("powernv8-two-sockets", "ppc64");
DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("powernv8-dupPHBs",
"ppc64");
+ DO_TEST_CAPS_ARCH_LATEST("powernv9-root-port", "ppc64");
+ DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("powernv9-dupPHBs",
"ppc64");
DO_TEST("pseries-basic",
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
diff --git a/tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml
b/tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml
new file mode 100644
index 0000000000..135489cf6e
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/powernv9-root-port.ppc64-latest.xml
@@ -0,0 +1,39 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='powernv9'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>POWER9</model>
+ </cpu>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='pci' index='0' model='pcie-root'>
+ <model name='pnv-phb4'/>
+ <target index='0' chip-id='0'/>
+ </controller>
+ <controller type='pci' index='1'
model='pcie-root-port'>
+ <model name='pnv-phb4-root-port'/>
+ <target chassis='1' port='0x0'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x00' function='0x0'/>
+ </controller>
+ <serial type='pty'>
+ <target type='isa-serial' port='0'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <audio id='1' type='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/powernv9-root-port.xml
b/tests/qemuxml2xmloutdata/powernv9-root-port.xml
new file mode 100644
index 0000000000..5649526969
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/powernv9-root-port.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>b20fcfe3-4a0a-4039-8735-9e024256e0f7</uuid>
+ <memory unit='KiB'>2097152</memory>
+ <currentMemory unit='KiB'>2097152</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='ppc64' machine='powernv9'>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/bin/qemu-system-ppc64</emulator>
+ <controller type='pci' index='0' model='pcie-root'>
+ <model name='pnv-phb4'/>
+ <target index='0' chip-id='0'/>
+ </controller>
+ <controller type='pci' index='1'
model='pcie-root-port'>
+ <model name='pnv-phb4-root-port'/>
+ <target chassis='1' port='0x0'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x00' function='0x0'/>
+ </controller>
+ <serial type='pty'>
+ <target type='isa-serial' port='0'>
+ <model name='isa-serial'/>
+ </target>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ <audio id='1' type='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 4514b5a6b2..a114d58457 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -665,6 +665,7 @@ mymain(void)
DO_TEST_CAPS_ARCH_LATEST("powernv8-basic", "ppc64");
DO_TEST_CAPS_ARCH_LATEST("powernv8-root-port", "ppc64");
DO_TEST_CAPS_ARCH_LATEST("powernv8-two-sockets", "ppc64");
+ DO_TEST_CAPS_ARCH_LATEST("powernv9-root-port", "ppc64");
DO_TEST("pseries-nvram",
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE,
--
2.35.1