Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1925363
Signed-off-by: Han Han <hhan(a)redhat.com>
---
src/qemu/qemu_command.c | 4 ++
src/qemu/qemu_hotplug.c | 3 +-
src/qemu/qemu_validate.c | 8 ++++
.../virtio-options-controller-page_per_vq.err | 1 +
...-controller-page_per_vq.x86_64-latest.args | 37 ++++++++++++++++++
.../virtio-options-controller-page_per_vq.xml | 38 ++++++++++++++++++
.../virtio-options-disk-page_per_vq.err | 1 +
...ptions-disk-page_per_vq.x86_64-latest.args | 39 +++++++++++++++++++
.../virtio-options-disk-page_per_vq.xml | 34 ++++++++++++++++
.../virtio-options-fs-page_per_vq.err | 1 +
...-options-fs-page_per_vq.x86_64-latest.args | 37 ++++++++++++++++++
.../virtio-options-fs-page_per_vq.xml | 34 ++++++++++++++++
.../virtio-options-input-page_per_vq.err | 1 +
...tions-input-page_per_vq.x86_64-latest.args | 35 +++++++++++++++++
.../virtio-options-input-page_per_vq.xml | 30 ++++++++++++++
.../virtio-options-memballoon-page_per_vq.err | 1 +
...-memballoon-page_per_vq.x86_64-latest.args | 33 ++++++++++++++++
.../virtio-options-memballoon-page_per_vq.xml | 23 +++++++++++
.../virtio-options-net-page_per_vq.err | 1 +
...options-net-page_per_vq.x86_64-latest.args | 37 ++++++++++++++++++
.../virtio-options-net-page_per_vq.xml | 34 ++++++++++++++++
.../virtio-options-rng-page_per_vq.err | 1 +
...options-rng-page_per_vq.x86_64-latest.args | 37 ++++++++++++++++++
.../virtio-options-rng-page_per_vq.xml | 32 +++++++++++++++
.../virtio-options-video-page_per_vq.err | 1 +
...tions-video-page_per_vq.x86_64-latest.args | 37 ++++++++++++++++++
.../virtio-options-video-page_per_vq.xml | 36 +++++++++++++++++
.../virtio-options.x86_64-latest.args | 26 ++++++-------
tests/qemuxml2argvdata/virtio-options.xml | 26 ++++++-------
tests/qemuxml2argvtest.c | 22 +++++++++++
30 files changed, 623 insertions(+), 27 deletions(-)
create mode 100644 tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.err
create mode 100644
tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.xml
create mode 100644 tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.err
create mode 100644
tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.xml
create mode 100644 tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.err
create mode 100644
tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.xml
create mode 100644 tests/qemuxml2argvdata/virtio-options-input-page_per_vq.err
create mode 100644
tests/qemuxml2argvdata/virtio-options-input-page_per_vq.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-options-input-page_per_vq.xml
create mode 100644 tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.err
create mode 100644
tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.xml
create mode 100644 tests/qemuxml2argvdata/virtio-options-net-page_per_vq.err
create mode 100644
tests/qemuxml2argvdata/virtio-options-net-page_per_vq.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-options-net-page_per_vq.xml
create mode 100644 tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.err
create mode 100644
tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.xml
create mode 100644 tests/qemuxml2argvdata/virtio-options-video-page_per_vq.err
create mode 100644
tests/qemuxml2argvdata/virtio-options-video-page_per_vq.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/virtio-options-video-page_per_vq.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b230314f7f..549f11dbe8 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -645,6 +645,10 @@ qemuBuildVirtioOptionsStr(virBuffer *buf,
virBufferAsprintf(buf, ",packed=%s",
virTristateSwitchTypeToString(virtio->packed));
}
+ if (virtio->page_per_vq != VIR_TRISTATE_SWITCH_ABSENT) {
+ virBufferAsprintf(buf, ",page-per-vq=%s",
+ virTristateSwitchTypeToString(virtio->page_per_vq));
+ }
}
static int
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9c16ab4567..f2553a6831 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -3678,7 +3678,8 @@ qemuDomainChangeNet(virQEMUDriver *driver,
(olddev->virtio && newdev->virtio &&
(olddev->virtio->iommu != newdev->virtio->iommu ||
olddev->virtio->ats != newdev->virtio->ats ||
- olddev->virtio->packed != newdev->virtio->packed))) {
+ olddev->virtio->packed != newdev->virtio->packed ||
+ olddev->virtio->page_per_vq != newdev->virtio->page_per_vq))) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("cannot modify virtio network device driver
options"));
goto cleanup;
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 1a470f1ff5..93e8b55651 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1478,6 +1478,14 @@ qemuValidateDomainVirtioOptions(const virDomainVirtioOptions
*virtio,
"QEMU binary"));
return -1;
}
+
+ if (virtio->page_per_vq != VIR_TRISTATE_SWITCH_ABSENT &&
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_PAGE_PER_VQ)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("the page_per_vq setting is not supported with this
"
+ "QEMU binary"));
+ return -1;
+ }
return 0;
}
diff --git a/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.err
b/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.err
new file mode 100644
index 0000000000..475aa8be43
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.err
@@ -0,0 +1 @@
+unsupported configuration: the page_per_vq setting is not supported with this QEMU
binary
diff --git
a/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.x86_64-latest.args
new file mode 100644
index 0000000000..3b11574410
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.x86_64-latest.args
@@ -0,0 +1,37 @@
+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-x86_64 \
+-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 pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-device virtio-scsi-pci,page-per-vq=on,id=scsi0,bus=pci.0,addr=0x2 \
+-device virtio-scsi-pci,page-per-vq=off,id=scsi1,bus=pci.0,addr=0x3 \
+-device virtio-serial-pci,id=virtio-serial0,page-per-vq=on,bus=pci.0,addr=0x4 \
+-device virtio-serial-pci,id=virtio-serial1,page-per-vq=off,bus=pci.0,addr=0x5 \
+-audiodev id=audio1,driver=none \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.xml
b/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.xml
new file mode 100644
index 0000000000..395142ba8a
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-controller-page_per_vq.xml
@@ -0,0 +1,38 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>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-x86_64</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <driver page_per_vq='on'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </controller>
+ <controller type='scsi' index='1' model='virtio-scsi'>
+ <driver page_per_vq='off'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
+ </controller>
+ <controller type='virtio-serial' index='0'>
+ <driver page_per_vq='on'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
+ </controller>
+ <controller type='virtio-serial' index='1'>
+ <driver page_per_vq='off'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x05' function='0x0'/>
+ </controller>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x06' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.err
b/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.err
new file mode 100644
index 0000000000..475aa8be43
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.err
@@ -0,0 +1 @@
+unsupported configuration: the page_per_vq setting is not supported with this QEMU
binary
diff --git a/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.x86_64-latest.args
new file mode 100644
index 0000000000..cd29709f48
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.x86_64-latest.args
@@ -0,0 +1,39 @@
+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-x86_64 \
+-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 pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-blockdev
'{"driver":"file","filename":"/var/lib/libvirt/images/img1","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-2-format","read-only":false,"driver":"raw","file":"libvirt-2-storage"}'
\
+-device
virtio-blk-pci,page-per-vq=on,bus=pci.0,addr=0x2,drive=libvirt-2-format,id=virtio-disk0,bootindex=1
\
+-blockdev
'{"driver":"file","filename":"/var/lib/libvirt/images/img2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
+-blockdev
'{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}'
\
+-device
virtio-blk-pci,page-per-vq=off,bus=pci.0,addr=0x3,drive=libvirt-1-format,id=virtio-disk1
\
+-audiodev id=audio1,driver=none \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.xml
b/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.xml
new file mode 100644
index 0000000000..8040685f7a
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-disk-page_per_vq.xml
@@ -0,0 +1,34 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>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-x86_64</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' page_per_vq='on'/>
+ <source file='/var/lib/libvirt/images/img1'/>
+ <target dev='vda' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </disk>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw' page_per_vq='off'/>
+ <source file='/var/lib/libvirt/images/img2'/>
+ <target dev='vdb' bus='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
+ </disk>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.err
b/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.err
new file mode 100644
index 0000000000..475aa8be43
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.err
@@ -0,0 +1 @@
+unsupported configuration: the page_per_vq setting is not supported with this QEMU
binary
diff --git a/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.x86_64-latest.args
new file mode 100644
index 0000000000..ee276aacfc
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.x86_64-latest.args
@@ -0,0 +1,37 @@
+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-x86_64 \
+-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 pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
+-device
virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,page-per-vq=on,bus=pci.0,addr=0x2 \
+-fsdev local,security_model=passthrough,id=fsdev-fs1,path=/export/fs2 \
+-device
virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,page-per-vq=off,bus=pci.0,addr=0x3 \
+-audiodev id=audio1,driver=none \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.xml
b/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.xml
new file mode 100644
index 0000000000..abf89ab53b
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-fs-page_per_vq.xml
@@ -0,0 +1,34 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>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-x86_64</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <filesystem type='mount' accessmode='passthrough'>
+ <driver page_per_vq='on'/>
+ <source dir='/export/fs1'/>
+ <target dir='fs1'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </filesystem>
+ <filesystem type='mount' accessmode='passthrough'>
+ <driver page_per_vq='off'/>
+ <source dir='/export/fs2'/>
+ <target dir='fs2'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
+ </filesystem>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.err
b/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.err
new file mode 100644
index 0000000000..475aa8be43
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.err
@@ -0,0 +1 @@
+unsupported configuration: the page_per_vq setting is not supported with this QEMU
binary
diff --git a/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.x86_64-latest.args
new file mode 100644
index 0000000000..96c3bb9d49
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.x86_64-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-x86_64 \
+-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 pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-device virtio-mouse-pci,id=input0,bus=pci.0,addr=0x2,page-per-vq=on \
+-device virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x3,page-per-vq=off \
+-audiodev id=audio1,driver=none \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.xml
b/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.xml
new file mode 100644
index 0000000000..e08234786b
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-input-page_per_vq.xml
@@ -0,0 +1,30 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>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-x86_64</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <input type='mouse' bus='virtio'>
+ <driver page_per_vq='on'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </input>
+ <input type='keyboard' bus='virtio'>
+ <driver page_per_vq='off'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
+ </input>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.err
b/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.err
new file mode 100644
index 0000000000..475aa8be43
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.err
@@ -0,0 +1 @@
+unsupported configuration: the page_per_vq setting is not supported with this QEMU
binary
diff --git
a/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.x86_64-latest.args
new file mode 100644
index 0000000000..790888af7f
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.x86_64-latest.args
@@ -0,0 +1,33 @@
+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-x86_64 \
+-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 pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-audiodev id=audio1,driver=none \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2,page-per-vq=on \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.xml
b/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.xml
new file mode 100644
index 0000000000..cf7c3da971
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-memballoon-page_per_vq.xml
@@ -0,0 +1,23 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>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-x86_64</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ <driver page_per_vq='on'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.err
b/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.err
new file mode 100644
index 0000000000..475aa8be43
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.err
@@ -0,0 +1 @@
+unsupported configuration: the page_per_vq setting is not supported with this QEMU
binary
diff --git a/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.x86_64-latest.args
new file mode 100644
index 0000000000..60a64ada5c
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.x86_64-latest.args
@@ -0,0 +1,37 @@
+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-x86_64 \
+-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 pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-netdev user,id=hostnet0 \
+-device
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,addr=0x2,page-per-vq=on
\
+-netdev user,id=hostnet1 \
+-device
virtio-net-pci,netdev=hostnet1,id=net1,mac=62:64:66:68:6a:6c,bus=pci.0,addr=0x3,page-per-vq=off
\
+-audiodev id=audio1,driver=none \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.xml
b/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.xml
new file mode 100644
index 0000000000..2c38daa0d5
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-net-page_per_vq.xml
@@ -0,0 +1,34 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>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-x86_64</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <interface type='user'>
+ <mac address='52:54:56:58:5a:5c'/>
+ <model type='virtio'/>
+ <driver page_per_vq='on'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </interface>
+ <interface type='user'>
+ <mac address='62:64:66:68:6a:6c'/>
+ <model type='virtio'/>
+ <driver page_per_vq='off'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
+ </interface>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.err
b/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.err
new file mode 100644
index 0000000000..475aa8be43
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.err
@@ -0,0 +1 @@
+unsupported configuration: the page_per_vq setting is not supported with this QEMU
binary
diff --git a/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.x86_64-latest.args
new file mode 100644
index 0000000000..e1b18c1bd3
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.x86_64-latest.args
@@ -0,0 +1,37 @@
+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-x86_64 \
+-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 pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-audiodev id=audio1,driver=none \
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
+-object
'{"qom-type":"rng-random","id":"objrng0","filename":"/dev/random"}'
\
+-device virtio-rng-pci,rng=objrng0,id=rng0,page-per-vq=on,bus=pci.0,addr=0x2 \
+-object
'{"qom-type":"rng-random","id":"objrng1","filename":"/dev/random"}'
\
+-device virtio-rng-pci,rng=objrng1,id=rng1,page-per-vq=off,bus=pci.0,addr=0x3 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.xml
b/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.xml
new file mode 100644
index 0000000000..c93d70156c
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-rng-page_per_vq.xml
@@ -0,0 +1,32 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>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-x86_64</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <rng model='virtio'>
+ <backend model='random'>/dev/random</backend>
+ <driver page_per_vq='on'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </rng>
+ <rng model='virtio'>
+ <backend model='random'>/dev/random</backend>
+ <driver page_per_vq='off'/>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
+ </rng>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.err
b/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.err
new file mode 100644
index 0000000000..475aa8be43
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.err
@@ -0,0 +1 @@
+unsupported configuration: the page_per_vq setting is not supported with this QEMU
binary
diff --git a/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.x86_64-latest.args
new file mode 100644
index 0000000000..905f3fe388
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.x86_64-latest.args
@@ -0,0 +1,37 @@
+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-x86_64 \
+-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 pc,accel=tcg,usb=off,dump-guest-core=off,memory-backend=pc.ram \
+-cpu qemu64 \
+-m 214 \
+-object
'{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'
\
+-overcommit mem-lock=off \
+-smp 1,sockets=1,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-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 \
+-no-acpi \
+-boot strict=on \
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
+-audiodev id=audio1,driver=none \
+-chardev socket,id=chr-vu-video0,fd=1729 \
+-chardev socket,id=chr-vu-video1,fd=1729 \
+-device
vhost-user-vga,id=video0,max_outputs=1,chardev=chr-vu-video0,bus=pci.0,addr=0x2,page-per-vq=on
\
+-device
vhost-user-gpu-pci,id=video1,max_outputs=1,chardev=chr-vu-video1,bus=pci.0,addr=0x3,page-per-vq=off
\
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4 \
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
+-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.xml
b/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.xml
new file mode 100644
index 0000000000..2d79932135
--- /dev/null
+++ b/tests/qemuxml2argvdata/virtio-options-video-page_per_vq.xml
@@ -0,0 +1,36 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>219136</memory>
+ <currentMemory unit='KiB'>219136</currentMemory>
+ <vcpu placement='static'>1</vcpu>
+ <os>
+ <type arch='x86_64' machine='pc'>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-x86_64</emulator>
+ <controller type='pci' index='0' model='pci-root'/>
+ <video>
+ <driver page_per_vq='on' name='vhostuser'/>
+ <model type='virtio' heads='1' primary='yes'>
+ <acceleration accel3d='yes' rendernode='/dev/dri/test'/>
+ </model>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x02' function='0x0'/>
+ </video>
+ <video>
+ <driver page_per_vq='off' name='vhostuser'/>
+ <model type='virtio' heads='1' primary='no'>
+ <acceleration accel3d='yes' rendernode='/dev/dri/test'/>
+ </model>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
+ </video>
+ <memballoon model='virtio'>
+ <address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
+ </memballoon>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args
b/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args
index 06a4520036..4b69080502 100644
--- a/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/virtio-options.x86_64-latest.args
@@ -27,26 +27,26 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-no-acpi \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
--device virtio-scsi-pci,iommu_platform=on,ats=on,packed=on,id=scsi0,bus=pci.0,addr=0x8 \
--device
virtio-serial-pci,id=virtio-serial0,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0x9
\
+-device
virtio-scsi-pci,iommu_platform=on,ats=on,packed=on,page-per-vq=on,id=scsi0,bus=pci.0,addr=0x8
\
+-device
virtio-serial-pci,id=virtio-serial0,iommu_platform=on,ats=on,packed=on,page-per-vq=on,bus=pci.0,addr=0x9
\
-blockdev
'{"driver":"file","filename":"/var/lib/libvirt/images/img1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}'
\
-blockdev
'{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}'
\
--device
virtio-blk-pci,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0xa,drive=libvirt-1-format,id=virtio-disk0,bootindex=1
\
+-device
virtio-blk-pci,iommu_platform=on,ats=on,packed=on,page-per-vq=on,bus=pci.0,addr=0xa,drive=libvirt-1-format,id=virtio-disk0,bootindex=1
\
-fsdev local,security_model=passthrough,id=fsdev-fs0,path=/export/fs1 \
--device
virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0x3
\
+-device
virtio-9p-pci,id=fs0,fsdev=fsdev-fs0,mount_tag=fs1,iommu_platform=on,ats=on,packed=on,page-per-vq=on,bus=pci.0,addr=0x3
\
-fsdev local,security_model=mapped,writeout=immediate,id=fsdev-fs1,path=/export/fs2 \
--device
virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0x4
\
+-device
virtio-9p-pci,id=fs1,fsdev=fsdev-fs1,mount_tag=fs2,iommu_platform=on,ats=on,packed=on,page-per-vq=on,bus=pci.0,addr=0x4
\
-netdev user,id=hostnet0 \
--device
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,addr=0x6,iommu_platform=on,ats=on,packed=on
\
--device virtio-mouse-pci,id=input0,bus=pci.0,addr=0xe,iommu_platform=on,ats=on,packed=on
\
--device
virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x10,iommu_platform=on,ats=on,packed=on \
--device
virtio-tablet-pci,id=input2,bus=pci.0,addr=0x11,iommu_platform=on,ats=on,packed=on \
--device
virtio-input-host-pci,id=input3,evdev=/dev/input/event1234,bus=pci.0,addr=0x12,iommu_platform=on,ats=on,packed=on
\
+-device
virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:56:58:5a:5c,bus=pci.0,addr=0x6,iommu_platform=on,ats=on,packed=on,page-per-vq=on
\
+-device
virtio-mouse-pci,id=input0,bus=pci.0,addr=0xe,iommu_platform=on,ats=on,packed=on,page-per-vq=on
\
+-device
virtio-keyboard-pci,id=input1,bus=pci.0,addr=0x10,iommu_platform=on,ats=on,packed=on,page-per-vq=on
\
+-device
virtio-tablet-pci,id=input2,bus=pci.0,addr=0x11,iommu_platform=on,ats=on,packed=on,page-per-vq=on
\
+-device
virtio-input-host-pci,id=input3,evdev=/dev/input/event1234,bus=pci.0,addr=0x12,iommu_platform=on,ats=on,packed=on,page-per-vq=on
\
-audiodev id=audio1,driver=none \
-chardev socket,id=chr-vu-video0,fd=1729 \
--device
vhost-user-vga,id=video0,max_outputs=1,chardev=chr-vu-video0,bus=pci.0,addr=0x2,iommu_platform=on,ats=on,packed=on
\
--device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc,iommu_platform=on,ats=on,packed=on \
+-device
vhost-user-vga,id=video0,max_outputs=1,chardev=chr-vu-video0,bus=pci.0,addr=0x2,iommu_platform=on,ats=on,packed=on,page-per-vq=on
\
+-device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xc,iommu_platform=on,ats=on,packed=on,page-per-vq=on
\
-object
'{"qom-type":"rng-random","id":"objrng0","filename":"/dev/random"}'
\
--device
virtio-rng-pci,rng=objrng0,id=rng0,iommu_platform=on,ats=on,packed=on,bus=pci.0,addr=0xd
\
+-device
virtio-rng-pci,rng=objrng0,id=rng0,iommu_platform=on,ats=on,packed=on,page-per-vq=on,bus=pci.0,addr=0xd
\
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
diff --git a/tests/qemuxml2argvdata/virtio-options.xml
b/tests/qemuxml2argvdata/virtio-options.xml
index 9c9b80d5c4..59e293d8e9 100644
--- a/tests/qemuxml2argvdata/virtio-options.xml
+++ b/tests/qemuxml2argvdata/virtio-options.xml
@@ -18,7 +18,7 @@
<devices>
<emulator>/usr/bin/qemu-system-x86_64</emulator>
<disk type='file' device='disk'>
- <driver name='qemu' type='raw' iommu='on'
ats='on' packed='on'/>
+ <driver name='qemu' type='raw' iommu='on'
ats='on' packed='on' page_per_vq='on'/>
<source file='/var/lib/libvirt/images/img1'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x0a' function='0x0'/>
@@ -30,22 +30,22 @@
<address type='pci' domain='0x0000' bus='0x00'
slot='0x01' function='0x1'/>
</controller>
<controller type='scsi' index='0' model='virtio-scsi'>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x08' function='0x0'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='virtio-serial' index='0'>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x09' function='0x0'/>
</controller>
<filesystem type='mount' accessmode='passthrough'>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<source dir='/export/fs1'/>
<target dir='fs1'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x03' function='0x0'/>
</filesystem>
<filesystem type='mount' accessmode='mapped'>
- <driver type='path' wrpolicy='immediate' iommu='on'
ats='on' packed='on'/>
+ <driver type='path' wrpolicy='immediate' iommu='on'
ats='on' packed='on' page_per_vq='on'/>
<source dir='/export/fs2'/>
<target dir='fs2'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x04' function='0x0'/>
@@ -53,23 +53,23 @@
<interface type='user'>
<mac address='52:54:56:58:5a:5c'/>
<model type='virtio'/>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x06' function='0x0'/>
</interface>
<input type='mouse' bus='virtio'>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x0e' function='0x0'/>
</input>
<input type='keyboard' bus='virtio'>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x10' function='0x0'/>
</input>
<input type='tablet' bus='virtio'>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x11' function='0x0'/>
</input>
<input type='passthrough' bus='virtio'>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<source evdev='/dev/input/event1234'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x12' function='0x0'/>
</input>
@@ -77,7 +77,7 @@
<input type='keyboard' bus='ps2'/>
<audio id='1' type='none'/>
<video>
- <driver iommu='on' ats='on' packed='on'
name='vhostuser'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on' name='vhostuser'/>
<model type='virtio' heads='1' primary='yes'>
<acceleration accel3d='yes' rendernode='/dev/dri/test'/>
</model>
@@ -85,11 +85,11 @@
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x0c' function='0x0'/>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
</memballoon>
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
- <driver iommu='on' ats='on' packed='on'/>
+ <driver iommu='on' ats='on' packed='on'
page_per_vq='on'/>
<address type='pci' domain='0x0000' bus='0x00'
slot='0x0d' function='0x0'/>
</rng>
</devices>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3b331d5fd4..67ec433a06 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -3348,6 +3348,14 @@ mymain(void)
DO_TEST_CAPS_LATEST("virtio-options-net-packed");
DO_TEST_CAPS_LATEST("virtio-options-rng-packed");
DO_TEST_CAPS_LATEST("virtio-options-video-packed");
+ DO_TEST_CAPS_LATEST("virtio-options-disk-page_per_vq");
+ DO_TEST_CAPS_LATEST("virtio-options-controller-page_per_vq");
+ DO_TEST_CAPS_LATEST("virtio-options-fs-page_per_vq");
+ DO_TEST_CAPS_LATEST("virtio-options-net-page_per_vq");
+ DO_TEST_CAPS_LATEST("virtio-options-memballoon-page_per_vq");
+ DO_TEST_CAPS_LATEST("virtio-options-video-page_per_vq");
+ DO_TEST_CAPS_LATEST("virtio-options-input-page_per_vq");
+ DO_TEST_CAPS_LATEST("virtio-options-rng-page_per_vq");
DO_TEST_PARSE_ERROR("virtio-options-controller-iommu",
QEMU_CAPS_VIRTIO_SCSI);
DO_TEST_PARSE_ERROR_NOCAPS("virtio-options-disk-iommu");
DO_TEST_PARSE_ERROR_NOCAPS("virtio-options-fs-iommu");
@@ -3388,6 +3396,20 @@ mymain(void)
QEMU_CAPS_DEVICE_VIRTIO_GPU,
QEMU_CAPS_VIRTIO_GPU_VIRGL,
QEMU_CAPS_DEVICE_VHOST_USER_GPU);
+ DO_TEST_PARSE_ERROR("virtio-options-controller-page_per_vq",
QEMU_CAPS_VIRTIO_SCSI);
+ DO_TEST_PARSE_ERROR_NOCAPS("virtio-options-disk-page_per_vq");
+ DO_TEST_PARSE_ERROR_NOCAPS("virtio-options-fs-page_per_vq");
+ DO_TEST_PARSE_ERROR("virtio-options-input-page_per_vq",
QEMU_CAPS_VIRTIO_MOUSE,
+ QEMU_CAPS_VIRTIO_KEYBOARD);
+ DO_TEST_PARSE_ERROR_NOCAPS("virtio-options-memballoon-page_per_vq");
+
DO_TEST_PARSE_ERROR_NOCAPS("virtio-options-memballoon-freepage-reporting");
+ DO_TEST_PARSE_ERROR_NOCAPS("virtio-options-net-page_per_vq");
+ DO_TEST_PARSE_ERROR("virtio-options-rng-page_per_vq",
QEMU_CAPS_DEVICE_VIRTIO_RNG,
+ QEMU_CAPS_OBJECT_RNG_RANDOM);
+ DO_TEST_PARSE_ERROR("virtio-options-video-page_per_vq",
QEMU_CAPS_DEVICE_VIRTIO_GPU,
+ QEMU_CAPS_DEVICE_VIRTIO_GPU,
+ QEMU_CAPS_VIRTIO_GPU_VIRGL,
+ QEMU_CAPS_DEVICE_VHOST_USER_GPU);
DO_TEST("fd-memory-numa-topology", QEMU_CAPS_OBJECT_MEMORY_FILE,
QEMU_CAPS_KVM);
--
2.31.1