Blame SOURCES/libvirt-qemu-command-Enable-formatting-vfio-pci.display-option-onto-cmdline.patch

982648
From edc91b968fea48d5c7141c3fd21ba6a89b6c2369 Mon Sep 17 00:00:00 2001
982648
Message-Id: <edc91b968fea48d5c7141c3fd21ba6a89b6c2369@dist-git>
982648
From: Erik Skultety <eskultet@redhat.com>
982648
Date: Thu, 19 Jul 2018 15:04:03 +0200
982648
Subject: [PATCH] qemu: command: Enable formatting vfio-pci.display option onto
982648
 cmdline
982648
MIME-Version: 1.0
982648
Content-Type: text/plain; charset=UTF-8
982648
Content-Transfer-Encoding: 8bit
982648
982648
Since QEMU 2.12, QEMU understands a new vfio-pci device option 'display'
982648
which can be used to turn on display capabilities on vgpu-enabled
982648
mediated devices, IOW emulated GPU devices like QXL will no longer be
982648
needed with vgpu-enable mdevs.
982648
QEMU defaults to 'auto' for the 'display' attribute, which is not
982648
foolproof, so we need to play it safe here and default to display='off'
982648
if this attribute wasn't provided in the XML explicitly.
982648
982648
Reviewed-by: Ján Tomko <jtomko@redhat.com>
982648
Signed-off-by: Erik Skultety <eskultet@redhat.com>
982648
(cherry picked from commit c0ca6dcf42549855b9ed75031f461a056ae1031c)
982648
982648
https://bugzilla.redhat.com/show_bug.cgi?id=1475770
982648
Signed-off-by: Erik Skultety <eskultet@redhat.com>
982648
Reviewed-by: Ján Tomko <jtomko@redhat.com>
982648
---
982648
 src/qemu/qemu_command.c                       |  4 ++
982648
 .../hostdev-mdev-display-missing-graphics.xml | 35 ++++++++++++++++
982648
 ...play-spice-egl-headless.x86_64-latest.args | 37 +++++++++++++++++
982648
 ...ostdev-mdev-display-spice-egl-headless.xml | 40 ++++++++++++++++++
982648
 ...ev-display-spice-opengl.x86_64-latest.args | 36 ++++++++++++++++
982648
 .../hostdev-mdev-display-spice-opengl.xml     | 41 +++++++++++++++++++
982648
 ...isplay-vnc-egl-headless.x86_64-latest.args | 37 +++++++++++++++++
982648
 .../hostdev-mdev-display-vnc-egl-headless.xml | 40 ++++++++++++++++++
982648
 ...ostdev-mdev-display-vnc.x86_64-latest.args | 36 ++++++++++++++++
982648
 .../hostdev-mdev-display-vnc.xml              | 39 ++++++++++++++++++
982648
 tests/qemuxml2argvtest.c                      |  7 ++++
982648
 11 files changed, 352 insertions(+)
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.xml
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.args
982648
 create mode 100644 tests/qemuxml2argvdata/hostdev-mdev-display-vnc.xml
982648
982648
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
982648
index 8915040c6a..1fce45134f 100644
982648
--- a/src/qemu/qemu_command.c
982648
+++ b/src/qemu/qemu_command.c
982648
@@ -5177,6 +5177,10 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def,
982648
     virBufferAdd(&buf, dev_str, -1);
982648
     virBufferAsprintf(&buf, ",id=%s,sysfsdev=%s", dev->info->alias, mdevPath);
982648
 
982648
+    if (mdevsrc->display != VIR_TRISTATE_SWITCH_ABSENT)
982648
+        virBufferAsprintf(&buf, ",display=%s",
982648
+                          virTristateSwitchTypeToString(mdevsrc->display));
982648
+
982648
     if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
982648
         goto cleanup;
982648
 
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml b/tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml
982648
new file mode 100644
982648
index 0000000000..ea559a6444
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml
982648
@@ -0,0 +1,35 @@
982648
+<domain type='qemu'>
982648
+  <name>QEMUGuest2</name>
982648
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
982648
+  <memory unit='KiB'>219136</memory>
982648
+  <currentMemory unit='KiB'>219136</currentMemory>
982648
+  <vcpu placement='static'>1</vcpu>
982648
+  <os>
982648
+    <type arch='i686' machine='pc'>hvm</type>
982648
+    <boot dev='hd'/>
982648
+  </os>
982648
+  <clock offset='utc'/>
982648
+  <on_poweroff>destroy</on_poweroff>
982648
+  <on_reboot>restart</on_reboot>
982648
+  <on_crash>destroy</on_crash>
982648
+  <devices>
982648
+    <emulator>/usr/bin/qemu-system-i686</emulator>
982648
+    <disk type='block' device='disk'>
982648
+      <driver name='qemu' type='raw'/>
982648
+      <source dev='/dev/HostVG/QEMUGuest2'/>
982648
+      <target dev='hda' bus='ide'/>
982648
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
982648
+    </disk>
982648
+    <controller type='usb' index='0'>
982648
+    </controller>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <controller type='ide' index='0'>
982648
+    </controller>
982648
+    <hostdev mode='subsystem' type='mdev' model='vfio-pci' display='on'>
982648
+      <source>
982648
+        <address uuid='53764d0e-85a0-42b4-af5c-2046b460b1dc'/>
982648
+      </source>
982648
+    </hostdev>
982648
+    <memballoon model='none'/>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
982648
new file mode 100644
982648
index 0000000000..0ac90c81d2
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.x86_64-latest.args
982648
@@ -0,0 +1,37 @@
982648
+LC_ALL=C \
982648
+PATH=/bin \
982648
+HOME=/home/test \
982648
+USER=test \
982648
+LOGNAME=test \
982648
+QEMU_AUDIO_DRV=spice \
982648
+/usr/bin/qemu-system-i686 \
982648
+-name guest=QEMUGuest2,debug-threads=on \
982648
+-S \
982648
+-object secret,id=masterKey0,format=raw,\
982648
+file=/tmp/lib/domain--1-QEMUGuest2/master-key.aes \
982648
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
982648
+-m 214 \
982648
+-realtime mlock=off \
982648
+-smp 1,sockets=1,cores=1,threads=1 \
982648
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
982648
+-no-user-config \
982648
+-nodefaults \
982648
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
982648
+-mon chardev=charmonitor,id=monitor,mode=control \
982648
+-rtc base=utc \
982648
+-no-shutdown \
982648
+-no-acpi \
982648
+-boot strict=on \
982648
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
982648
+-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
982648
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
982648
+-spice port=0,seamless-migration=on \
982648
+-display egl-headless \
982648
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,\
982648
+vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
982648
+-device vfio-pci,id=hostdev0,\
982648
+sysfsdev=/sys/bus/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc,display=on,\
982648
+bus=pci.0,addr=0x3 \
982648
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
982648
+resourcecontrol=deny \
982648
+-msg timestamp=on
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.xml b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.xml
982648
new file mode 100644
982648
index 0000000000..c8f10c2f3a
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-egl-headless.xml
982648
@@ -0,0 +1,40 @@
982648
+<domain type='qemu' id='1'>
982648
+  <name>QEMUGuest2</name>
982648
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
982648
+  <memory unit='KiB'>219136</memory>
982648
+  <currentMemory unit='KiB'>219136</currentMemory>
982648
+  <vcpu placement='static'>1</vcpu>
982648
+  <os>
982648
+    <type arch='i686' machine='pc'>hvm</type>
982648
+    <boot dev='hd'/>
982648
+  </os>
982648
+  <clock offset='utc'/>
982648
+  <on_poweroff>destroy</on_poweroff>
982648
+  <on_reboot>restart</on_reboot>
982648
+  <on_crash>destroy</on_crash>
982648
+  <devices>
982648
+    <emulator>/usr/bin/qemu-system-i686</emulator>
982648
+    <disk type='block' device='disk'>
982648
+      <driver name='qemu' type='raw'/>
982648
+      <source dev='/dev/HostVG/QEMUGuest2'/>
982648
+      <target dev='hda' bus='ide'/>
982648
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
982648
+    </disk>
982648
+    <controller type='usb' index='0'>
982648
+    </controller>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <controller type='ide' index='0'>
982648
+    </controller>
982648
+    <graphics type='spice'/>
982648
+    <graphics type='egl-headless'/>
982648
+    <hostdev mode='subsystem' type='mdev' model='vfio-pci' display='on'>
982648
+      <source>
982648
+        <address uuid='53764d0e-85a0-42b4-af5c-2046b460b1dc'/>
982648
+      </source>
982648
+    </hostdev>
982648
+    <video>
982648
+      <model type='qxl' heads='1'/>
982648
+    </video>
982648
+    <memballoon model='none'/>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
982648
new file mode 100644
982648
index 0000000000..1fd9fdaa16
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.x86_64-latest.args
982648
@@ -0,0 +1,36 @@
982648
+LC_ALL=C \
982648
+PATH=/bin \
982648
+HOME=/home/test \
982648
+USER=test \
982648
+LOGNAME=test \
982648
+QEMU_AUDIO_DRV=spice \
982648
+/usr/bin/qemu-system-i686 \
982648
+-name guest=QEMUGuest2,debug-threads=on \
982648
+-S \
982648
+-object secret,id=masterKey0,format=raw,\
982648
+file=/tmp/lib/domain--1-QEMUGuest2/master-key.aes \
982648
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
982648
+-m 214 \
982648
+-realtime mlock=off \
982648
+-smp 1,sockets=1,cores=1,threads=1 \
982648
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
982648
+-no-user-config \
982648
+-nodefaults \
982648
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
982648
+-mon chardev=charmonitor,id=monitor,mode=control \
982648
+-rtc base=utc \
982648
+-no-shutdown \
982648
+-no-acpi \
982648
+-boot strict=on \
982648
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
982648
+-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
982648
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
982648
+-spice port=0,gl=on,rendernode=/dev/dri/foo,seamless-migration=on \
982648
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,\
982648
+vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
982648
+-device vfio-pci,id=hostdev0,\
982648
+sysfsdev=/sys/bus/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc,display=on,\
982648
+bus=pci.0,addr=0x3 \
982648
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
982648
+resourcecontrol=deny \
982648
+-msg timestamp=on
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml
982648
new file mode 100644
982648
index 0000000000..18c9817608
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-spice-opengl.xml
982648
@@ -0,0 +1,41 @@
982648
+<domain type='qemu' id='1'>
982648
+  <name>QEMUGuest2</name>
982648
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
982648
+  <memory unit='KiB'>219136</memory>
982648
+  <currentMemory unit='KiB'>219136</currentMemory>
982648
+  <vcpu placement='static'>1</vcpu>
982648
+  <os>
982648
+    <type arch='i686' machine='pc'>hvm</type>
982648
+    <boot dev='hd'/>
982648
+  </os>
982648
+  <clock offset='utc'/>
982648
+  <on_poweroff>destroy</on_poweroff>
982648
+  <on_reboot>restart</on_reboot>
982648
+  <on_crash>destroy</on_crash>
982648
+  <devices>
982648
+    <emulator>/usr/bin/qemu-system-i686</emulator>
982648
+    <disk type='block' device='disk'>
982648
+      <driver name='qemu' type='raw'/>
982648
+      <source dev='/dev/HostVG/QEMUGuest2'/>
982648
+      <target dev='hda' bus='ide'/>
982648
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
982648
+    </disk>
982648
+    <controller type='usb' index='0'>
982648
+    </controller>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <controller type='ide' index='0'>
982648
+    </controller>
982648
+    <graphics type='spice'>
982648
+      <gl enable='yes' rendernode='/dev/dri/foo'/>
982648
+    </graphics>
982648
+    <hostdev mode='subsystem' type='mdev' model='vfio-pci' display='on'>
982648
+      <source>
982648
+        <address uuid='53764d0e-85a0-42b4-af5c-2046b460b1dc'/>
982648
+      </source>
982648
+    </hostdev>
982648
+    <video>
982648
+      <model type='qxl' heads='1'/>
982648
+    </video>
982648
+    <memballoon model='none'/>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
982648
new file mode 100644
982648
index 0000000000..cdf545d0e0
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.x86_64-latest.args
982648
@@ -0,0 +1,37 @@
982648
+LC_ALL=C \
982648
+PATH=/bin \
982648
+HOME=/home/test \
982648
+USER=test \
982648
+LOGNAME=test \
982648
+QEMU_AUDIO_DRV=none \
982648
+/usr/bin/qemu-system-i686 \
982648
+-name guest=QEMUGuest2,debug-threads=on \
982648
+-S \
982648
+-object secret,id=masterKey0,format=raw,\
982648
+file=/tmp/lib/domain--1-QEMUGuest2/master-key.aes \
982648
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
982648
+-m 214 \
982648
+-realtime mlock=off \
982648
+-smp 1,sockets=1,cores=1,threads=1 \
982648
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
982648
+-no-user-config \
982648
+-nodefaults \
982648
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
982648
+-mon chardev=charmonitor,id=monitor,mode=control \
982648
+-rtc base=utc \
982648
+-no-shutdown \
982648
+-no-acpi \
982648
+-boot strict=on \
982648
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
982648
+-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
982648
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
982648
+-vnc 127.0.0.1:0 \
982648
+-display egl-headless \
982648
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,\
982648
+vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
982648
+-device vfio-pci,id=hostdev0,\
982648
+sysfsdev=/sys/bus/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc,display=on,\
982648
+bus=pci.0,addr=0x3 \
982648
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
982648
+resourcecontrol=deny \
982648
+-msg timestamp=on
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml
982648
new file mode 100644
982648
index 0000000000..b3eaeeef13
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc-egl-headless.xml
982648
@@ -0,0 +1,40 @@
982648
+<domain type='qemu' id='1'>
982648
+  <name>QEMUGuest2</name>
982648
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
982648
+  <memory unit='KiB'>219136</memory>
982648
+  <currentMemory unit='KiB'>219136</currentMemory>
982648
+  <vcpu placement='static'>1</vcpu>
982648
+  <os>
982648
+    <type arch='i686' machine='pc'>hvm</type>
982648
+    <boot dev='hd'/>
982648
+  </os>
982648
+  <clock offset='utc'/>
982648
+  <on_poweroff>destroy</on_poweroff>
982648
+  <on_reboot>restart</on_reboot>
982648
+  <on_crash>destroy</on_crash>
982648
+  <devices>
982648
+    <emulator>/usr/bin/qemu-system-i686</emulator>
982648
+    <disk type='block' device='disk'>
982648
+      <driver name='qemu' type='raw'/>
982648
+      <source dev='/dev/HostVG/QEMUGuest2'/>
982648
+      <target dev='hda' bus='ide'/>
982648
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
982648
+    </disk>
982648
+    <controller type='usb' index='0'>
982648
+    </controller>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <controller type='ide' index='0'>
982648
+    </controller>
982648
+    <graphics type='vnc'/>
982648
+    <graphics type='egl-headless'/>
982648
+    <hostdev mode='subsystem' type='mdev' model='vfio-pci' display='on'>
982648
+      <source>
982648
+        <address uuid='53764d0e-85a0-42b4-af5c-2046b460b1dc'/>
982648
+      </source>
982648
+    </hostdev>
982648
+    <video>
982648
+      <model type='qxl' heads='1'/>
982648
+    </video>
982648
+    <memballoon model='none'/>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.args b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.args
982648
new file mode 100644
982648
index 0000000000..19439afda9
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.x86_64-latest.args
982648
@@ -0,0 +1,36 @@
982648
+LC_ALL=C \
982648
+PATH=/bin \
982648
+HOME=/home/test \
982648
+USER=test \
982648
+LOGNAME=test \
982648
+QEMU_AUDIO_DRV=none \
982648
+/usr/bin/qemu-system-i686 \
982648
+-name guest=QEMUGuest2,debug-threads=on \
982648
+-S \
982648
+-object secret,id=masterKey0,format=raw,\
982648
+file=/tmp/lib/domain--1-QEMUGuest2/master-key.aes \
982648
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
982648
+-m 214 \
982648
+-realtime mlock=off \
982648
+-smp 1,sockets=1,cores=1,threads=1 \
982648
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
982648
+-no-user-config \
982648
+-nodefaults \
982648
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
982648
+-mon chardev=charmonitor,id=monitor,mode=control \
982648
+-rtc base=utc \
982648
+-no-shutdown \
982648
+-no-acpi \
982648
+-boot strict=on \
982648
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
982648
+-drive file=/dev/HostVG/QEMUGuest2,format=raw,if=none,id=drive-ide0-0-0 \
982648
+-device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 \
982648
+-vnc 127.0.0.1:0 \
982648
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,\
982648
+vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
982648
+-device vfio-pci,id=hostdev0,\
982648
+sysfsdev=/sys/bus/mdev/devices/53764d0e-85a0-42b4-af5c-2046b460b1dc,display=on,\
982648
+bus=pci.0,addr=0x3 \
982648
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
982648
+resourcecontrol=deny \
982648
+-msg timestamp=on
982648
diff --git a/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.xml b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.xml
982648
new file mode 100644
982648
index 0000000000..f5b3575c04
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/hostdev-mdev-display-vnc.xml
982648
@@ -0,0 +1,39 @@
982648
+<domain type='qemu' id='1'>
982648
+  <name>QEMUGuest2</name>
982648
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
982648
+  <memory unit='KiB'>219136</memory>
982648
+  <currentMemory unit='KiB'>219136</currentMemory>
982648
+  <vcpu placement='static'>1</vcpu>
982648
+  <os>
982648
+    <type arch='i686' machine='pc'>hvm</type>
982648
+    <boot dev='hd'/>
982648
+  </os>
982648
+  <clock offset='utc'/>
982648
+  <on_poweroff>destroy</on_poweroff>
982648
+  <on_reboot>restart</on_reboot>
982648
+  <on_crash>destroy</on_crash>
982648
+  <devices>
982648
+    <emulator>/usr/bin/qemu-system-i686</emulator>
982648
+    <disk type='block' device='disk'>
982648
+      <driver name='qemu' type='raw'/>
982648
+      <source dev='/dev/HostVG/QEMUGuest2'/>
982648
+      <target dev='hda' bus='ide'/>
982648
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
982648
+    </disk>
982648
+    <controller type='usb' index='0'>
982648
+    </controller>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <controller type='ide' index='0'>
982648
+    </controller>
982648
+    <graphics type='vnc'/>
982648
+    <hostdev mode='subsystem' type='mdev' model='vfio-pci' display='on'>
982648
+      <source>
982648
+        <address uuid='53764d0e-85a0-42b4-af5c-2046b460b1dc'/>
982648
+      </source>
982648
+    </hostdev>
982648
+    <video>
982648
+      <model type='qxl' heads='1'/>
982648
+    </video>
982648
+    <memballoon model='none'/>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
982648
index 848e40440a..9237a4fb89 100644
982648
--- a/tests/qemuxml2argvtest.c
982648
+++ b/tests/qemuxml2argvtest.c
982648
@@ -1591,6 +1591,13 @@ mymain(void)
982648
             QEMU_CAPS_DEVICE_VFIO_PCI);
982648
     DO_TEST_PARSE_ERROR("hostdev-mdev-invalid-target-address",
982648
             QEMU_CAPS_DEVICE_VFIO_PCI);
982648
+    DO_TEST_CAPS_LATEST("hostdev-mdev-display-spice-opengl");
982648
+    DO_TEST_CAPS_LATEST("hostdev-mdev-display-spice-egl-headless");
982648
+    DO_TEST_CAPS_LATEST("hostdev-mdev-display-vnc");
982648
+    DO_TEST_CAPS_LATEST("hostdev-mdev-display-vnc-egl-headless");
982648
+    DO_TEST_PARSE_ERROR("hostdev-mdev-display-missing-graphics",
982648
+            QEMU_CAPS_DEVICE_VFIO_PCI,
982648
+            QEMU_CAPS_VFIO_PCI_DISPLAY);
982648
     DO_TEST("pci-rom", NONE);
982648
     DO_TEST("pci-rom-disabled", NONE);
982648
     DO_TEST("pci-rom-disabled-invalid", NONE);
982648
-- 
982648
2.18.0
982648