This verifies that, for each architecture, libvirt will pick a
reasonable default model for network interface where the user
hasn't provided the information themselves.
Note that pSeries guests currently get rtl8139 network cards by
default, which makes little sense for the architecture. We're
going to improve the situation in an upcoming commit.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
.../aarch64-default-net.aarch64-latest.args | 35 +++++++++++++++
.../qemuxml2argvdata/aarch64-default-net.xml | 17 ++++++++
.../ppc64-default-net.ppc64-latest.args | 33 ++++++++++++++
tests/qemuxml2argvdata/ppc64-default-net.xml | 17 ++++++++
.../riscv64-default-net.riscv64-latest.args | 34 +++++++++++++++
.../qemuxml2argvdata/riscv64-default-net.xml | 17 ++++++++
.../s390x-default-net.s390x-latest.args | 33 ++++++++++++++
tests/qemuxml2argvdata/s390x-default-net.xml | 17 ++++++++
.../x86_64-default-net.x86_64-latest.args | 33 ++++++++++++++
tests/qemuxml2argvdata/x86_64-default-net.xml | 17 ++++++++
tests/qemuxml2argvtest.c | 6 +++
.../aarch64-default-net.aarch64-latest.xml | 43 +++++++++++++++++++
.../ppc64-default-net.ppc64-latest.xml | 34 +++++++++++++++
.../riscv64-default-net.riscv64-latest.xml | 37 ++++++++++++++++
.../s390x-default-net.s390x-latest.xml | 31 +++++++++++++
.../x86_64-default-net.x86_64-latest.xml | 32 ++++++++++++++
tests/qemuxml2xmltest.c | 7 +++
17 files changed, 443 insertions(+)
create mode 100644 tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args
create mode 100644 tests/qemuxml2argvdata/aarch64-default-net.xml
create mode 100644 tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args
create mode 100644 tests/qemuxml2argvdata/ppc64-default-net.xml
create mode 100644 tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args
create mode 100644 tests/qemuxml2argvdata/riscv64-default-net.xml
create mode 100644 tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/s390x-default-net.xml
create mode 100644 tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/x86_64-default-net.xml
create mode 100644 tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml
create mode 100644 tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml
diff --git a/tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args
b/tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args
new file mode 100644
index 0000000000..3df9155252
--- /dev/null
+++ b/tests/qemuxml2argvdata/aarch64-default-net.aarch64-latest.args
@@ -0,0 +1,35 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-aarch64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}'
\
+-machine
virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \
+-accel tcg \
+-cpu cortex-a15 \
+-m size=4194304k \
+-object
'{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":4294967296}'
\
+-overcommit mem-lock=off \
+-smp 4,sockets=4,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-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":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}'
\
+-device
'{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}'
\
+-netdev '{"type":"user","id":"hostnet0"}'
\
+-device
'{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}'
\
+-audiodev
'{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/aarch64-default-net.xml
b/tests/qemuxml2argvdata/aarch64-default-net.xml
new file mode 100644
index 0000000000..12dbf47fb0
--- /dev/null
+++ b/tests/qemuxml2argvdata/aarch64-default-net.xml
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory>4194304</memory>
+ <vcpu>4</vcpu>
+ <os>
+ <type arch='aarch64' machine='virt'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <controller type='usb' model='none'/>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ </interface>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args
b/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args
new file mode 100644
index 0000000000..4180c247d4
--- /dev/null
+++ b/tests/qemuxml2argvdata/ppc64-default-net.ppc64-latest.args
@@ -0,0 +1,33 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-ppc64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}'
\
+-machine pseries,usb=off,dump-guest-core=off,memory-backend=ppc_spapr.ram \
+-accel tcg \
+-cpu POWER9 \
+-m size=4194304k \
+-object
'{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":4294967296}'
\
+-overcommit mem-lock=off \
+-smp 4,sockets=4,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-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 \
+-netdev user,id=hostnet0 \
+-device
'{"driver":"rtl8139","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x1"}'
\
+-audiodev
'{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/ppc64-default-net.xml
b/tests/qemuxml2argvdata/ppc64-default-net.xml
new file mode 100644
index 0000000000..208a5d48a3
--- /dev/null
+++ b/tests/qemuxml2argvdata/ppc64-default-net.xml
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory>4194304</memory>
+ <vcpu>4</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-ppc64</emulator>
+ <controller type='usb' model='none'/>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ </interface>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args
b/tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args
new file mode 100644
index 0000000000..fb6d4b781f
--- /dev/null
+++ b/tests/qemuxml2argvdata/riscv64-default-net.riscv64-latest.args
@@ -0,0 +1,34 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-riscv64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}'
\
+-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \
+-accel tcg \
+-m size=4194304k \
+-object
'{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":4294967296}'
\
+-overcommit mem-lock=off \
+-smp 4,sockets=4,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-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":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}'
\
+-device
'{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}'
\
+-netdev '{"type":"user","id":"hostnet0"}'
\
+-device
'{"driver":"virtio-net-pci","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.1","addr":"0x0"}'
\
+-audiodev
'{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/riscv64-default-net.xml
b/tests/qemuxml2argvdata/riscv64-default-net.xml
new file mode 100644
index 0000000000..8d1bd4807c
--- /dev/null
+++ b/tests/qemuxml2argvdata/riscv64-default-net.xml
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory>4194304</memory>
+ <vcpu>4</vcpu>
+ <os>
+ <type arch='riscv64' machine='virt'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-riscv64</emulator>
+ <controller type='usb' model='none'/>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ </interface>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args
b/tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args
new file mode 100644
index 0000000000..1809a5a645
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390x-default-net.s390x-latest.args
@@ -0,0 +1,33 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-s390x \
+-name guest=guest,debug-threads=on \
+-S \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}'
\
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
+-accel tcg \
+-cpu qemu \
+-m size=4194304k \
+-object
'{"qom-type":"memory-backend-ram","id":"s390.ram","size":4294967296}'
\
+-overcommit mem-lock=off \
+-smp 4,sockets=4,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-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 \
+-netdev '{"type":"user","id":"hostnet0"}'
\
+-device
'{"driver":"virtio-net-ccw","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","devno":"fe.0.0000"}'
\
+-audiodev
'{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/s390x-default-net.xml
b/tests/qemuxml2argvdata/s390x-default-net.xml
new file mode 100644
index 0000000000..0ae2f2ede7
--- /dev/null
+++ b/tests/qemuxml2argvdata/s390x-default-net.xml
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory>4194304</memory>
+ <vcpu>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <controller type='usb' model='none'/>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ </interface>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args
b/tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args
new file mode 100644
index 0000000000..7f9a558cf8
--- /dev/null
+++ b/tests/qemuxml2argvdata/x86_64-default-net.x86_64-latest.args
@@ -0,0 +1,33 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
+/usr/bin/qemu-system-x86_64 \
+-name guest=guest,debug-threads=on \
+-S \
+-object
'{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}'
\
+-machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=off \
+-accel tcg \
+-cpu qemu64 \
+-m size=4194304k \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":4294967296}'
\
+-overcommit mem-lock=off \
+-smp 4,sockets=4,cores=1,threads=1 \
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
+-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 \
+-netdev '{"type":"user","id":"hostnet0"}'
\
+-device
'{"driver":"rtl8139","netdev":"hostnet0","id":"net0","mac":"52:54:00:09:a4:37","bus":"pci.0","addr":"0x2"}'
\
+-audiodev
'{"id":"audio1","driver":"none"}' \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/x86_64-default-net.xml
b/tests/qemuxml2argvdata/x86_64-default-net.xml
new file mode 100644
index 0000000000..2513f75a10
--- /dev/null
+++ b/tests/qemuxml2argvdata/x86_64-default-net.xml
@@ -0,0 +1,17 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory>4194304</memory>
+ <vcpu>4</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ </os>
+ <devices>
+ <emulator>/usr/bin/qemu-system-x86_64</emulator>
+ <controller type='usb' model='none'/>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ </interface>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 5b36a297e0..9bd228e4fa 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1531,6 +1531,12 @@ mymain(void)
DO_TEST_CAPS_LATEST_PARSE_ERROR("vhost_queues-invalid");
+ DO_TEST_CAPS_LATEST("x86_64-default-net");
+ DO_TEST_CAPS_ARCH_LATEST("aarch64-default-net", "aarch64");
+ DO_TEST_CAPS_ARCH_LATEST("riscv64-default-net", "riscv64");
+ DO_TEST_CAPS_ARCH_LATEST("ppc64-default-net", "ppc64");
+ DO_TEST_CAPS_ARCH_LATEST("s390x-default-net", "s390x");
+
DO_TEST_CAPS_LATEST("net-vhostuser");
DO_TEST_CAPS_LATEST("net-vhostuser-multiq");
DO_TEST_CAPS_LATEST_FAILURE("net-vhostuser-fail");
diff --git a/tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml
b/tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml
new file mode 100644
index 0000000000..c67277a181
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/aarch64-default-net.aarch64-latest.xml
@@ -0,0 +1,43 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='aarch64' machine='virt'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <features>
+ <gic version='2'/>
+ </features>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>cortex-a15</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-aarch64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1'
model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='1' port='0x8'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='pci' index='2'
model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='2' port='0x9'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x01'
slot='0x00' function='0x0'/>
+ </interface>
+ <audio id='1' type='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml
b/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml
new file mode 100644
index 0000000000..fa83b6e290
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/ppc64-default-net.ppc64-latest.xml
@@ -0,0 +1,34 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='ppc64' machine='pseries'>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='usb' index='0' model='none'/>
+ <controller type='pci' index='0' model='pci-root'>
+ <model name='spapr-pci-host-bridge'/>
+ <target index='0'/>
+ </controller>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ <model type='rtl8139'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x0'/>
+ </interface>
+ <audio id='1' type='none'/>
+ <memballoon model='none'/>
+ <panic model='pseries'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml
b/tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml
new file mode 100644
index 0000000000..b8c881722c
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/riscv64-default-net.riscv64-latest.xml
@@ -0,0 +1,37 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='riscv64' machine='virt'>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-riscv64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <controller type='pci' index='0' model='pcie-root'/>
+ <controller type='pci' index='1'
model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='1' port='0x8'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x0' multifunction='on'/>
+ </controller>
+ <controller type='pci' index='2'
model='pcie-root-port'>
+ <model name='pcie-root-port'/>
+ <target chassis='2' port='0x9'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
+ </controller>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x01'
slot='0x00' function='0x0'/>
+ </interface>
+ <audio id='1' type='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml
b/tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml
new file mode 100644
index 0000000000..fd60d0bbf3
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/s390x-default-net.s390x-latest.xml
@@ -0,0 +1,31 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu</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-s390x</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ <model type='virtio'/>
+ <address type='ccw' cssid='0xfe' ssid='0x0'
devno='0x0000'/>
+ </interface>
+ <audio id='1' type='none'/>
+ <memballoon model='none'/>
+ <panic model='s390'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml
b/tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml
new file mode 100644
index 0000000000..9d393f7aa9
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/x86_64-default-net.x86_64-latest.xml
@@ -0,0 +1,32 @@
+<domain type='qemu'>
+ <name>guest</name>
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
+ <memory unit='KiB'>4194304</memory>
+ <currentMemory unit='KiB'>4194304</currentMemory>
+ <vcpu placement='static'>4</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>hvm</type>
+ <boot dev='hd'/>
+ </os>
+ <cpu mode='custom' match='exact' check='none'>
+ <model fallback='forbid'>qemu64</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-x86_64</emulator>
+ <controller type='usb' index='0' model='none'/>
+ <controller type='pci' index='0' model='pci-root'/>
+ <interface type='user'>
+ <mac address='52:54:00:09:a4:37'/>
+ <model type='rtl8139'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </interface>
+ <input type='mouse' bus='ps2'/>
+ <input type='keyboard' bus='ps2'/>
+ <audio id='1' type='none'/>
+ <memballoon model='none'/>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index a443f1e87e..5a635444f8 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -376,6 +376,13 @@ mymain(void)
DO_TEST_CAPS_LATEST("misc-enable-s4");
DO_TEST_CAPS_LATEST("misc-no-reboot");
DO_TEST_CAPS_LATEST("misc-uuid");
+
+ DO_TEST_CAPS_LATEST("x86_64-default-net");
+ DO_TEST_CAPS_ARCH_LATEST("aarch64-default-net", "aarch64");
+ DO_TEST_CAPS_ARCH_LATEST("riscv64-default-net", "riscv64");
+ DO_TEST_CAPS_ARCH_LATEST("ppc64-default-net", "ppc64");
+ DO_TEST_CAPS_ARCH_LATEST("s390x-default-net", "s390x");
+
DO_TEST_CAPS_LATEST("net-vhostuser");
DO_TEST_CAPS_LATEST("net-user");
DO_TEST_CAPS_LATEST("net-user-addr");
--
2.43.0