982648
From 437293e3e1ac3fc43aca6d0ceb436f937a08d5e4 Mon Sep 17 00:00:00 2001
982648
Message-Id: <437293e3e1ac3fc43aca6d0ceb436f937a08d5e4@dist-git>
982648
From: Erik Skultety <eskultet@redhat.com>
982648
Date: Thu, 19 Jul 2018 15:04:05 +0200
982648
Subject: [PATCH] conf: Introduce new video type 'none'
982648
MIME-Version: 1.0
982648
Content-Type: text/plain; charset=UTF-8
982648
Content-Transfer-Encoding: 8bit
982648
982648
Historically, we've always enabled an emulated video device every time we
982648
see that graphics should be supported with a guest. With the appearance
982648
of mediated devices which can support QEMU's vfio-display capability,
982648
users might want to use such a device as the only video device.
982648
Therefore introduce a new, effectively a 'disable', type for video
982648
device.
982648
982648
Reviewed-by: Ján Tomko <jtomko@redhat.com>
982648
Signed-off-by: Erik Skultety <eskultet@redhat.com>
982648
(cherry picked from commit d48813e81af798e3027edcc2f41be2630111ba65)
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
 docs/formatdomain.html.in                     | 13 +++-
982648
 docs/schemas/domaincommon.rng                 |  1 +
982648
 src/conf/domain_conf.c                        | 61 +++++++++++++------
982648
 src/conf/domain_conf.h                        |  1 +
982648
 src/qemu/qemu_command.c                       | 12 +++-
982648
 src/qemu/qemu_domain.c                        |  2 +
982648
 src/qemu/qemu_domain_address.c                |  7 ++-
982648
 tests/domaincapsschemadata/full.xml           |  1 +
982648
 .../video-invalid-multiple-devices.xml        | 33 ++++++++++
982648
 tests/qemuxml2argvdata/video-none-device.args | 27 ++++++++
982648
 tests/qemuxml2argvdata/video-none-device.xml  | 39 ++++++++++++
982648
 tests/qemuxml2argvtest.c                      |  4 +-
982648
 .../qemuxml2xmloutdata/video-none-device.xml  | 42 +++++++++++++
982648
 tests/qemuxml2xmltest.c                       |  1 +
982648
 14 files changed, 220 insertions(+), 24 deletions(-)
982648
 create mode 100644 tests/qemuxml2argvdata/video-invalid-multiple-devices.xml
982648
 create mode 100644 tests/qemuxml2argvdata/video-none-device.args
982648
 create mode 100644 tests/qemuxml2argvdata/video-none-device.xml
982648
 create mode 100644 tests/qemuxml2xmloutdata/video-none-device.xml
982648
982648
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
982648
index 0e8f0a125f..42acf7a828 100644
982648
--- a/docs/formatdomain.html.in
982648
+++ b/docs/formatdomain.html.in
982648
@@ -6666,9 +6666,18 @@ qemu-kvm -net nic,model=? /dev/null
982648
           The model element has a mandatory type
982648
           attribute which takes the value "vga", "cirrus", "vmvga", "xen",
982648
           "vbox", "qxl" (since 0.8.6),
982648
-          "virtio" (since 1.3.0)
982648
-          or "gop" (since 3.2.0)
982648
+          "virtio" (since 1.3.0),
982648
+          "gop" (since 3.2.0), or
982648
+          "none" (since 4.6.0)
982648
           depending on the hypervisor features available.
982648
+          The purpose of the type none is to instruct libvirt not
982648
+          to add a default video device in the guest (see the paragraph above).
982648
+          This legacy behaviour can be inconvenient in cases where GPU mediated
982648
+          devices are meant to be the only rendering device within a guest and
982648
+          so specifying another video device along with type
982648
+          none.
982648
+          Refer to Host device assignment to see
982648
+          how to add a mediated device into a guest.
982648
         

982648
         

982648
           You can provide the amount of video memory in kibibytes (blocks of
982648
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
982648
index be8430ab22..ac04af51a1 100644
982648
--- a/docs/schemas/domaincommon.rng
982648
+++ b/docs/schemas/domaincommon.rng
982648
@@ -3454,6 +3454,7 @@
982648
                 <value>vbox</value>
982648
                 <value>virtio</value>
982648
                 <value>gop</value>
982648
+                <value>none</value>
982648
               </choice>
982648
             </attribute>
982648
             <group>
982648
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
982648
index 830c298158..23288aa01b 100644
982648
--- a/src/conf/domain_conf.c
982648
+++ b/src/conf/domain_conf.c
982648
@@ -590,7 +590,8 @@ VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST,
982648
               "qxl",
982648
               "parallels",
982648
               "virtio",
982648
-              "gop")
982648
+              "gop",
982648
+              "none")
982648
 
982648
 VIR_ENUM_IMPL(virDomainVideoVGAConf, VIR_DOMAIN_VIDEO_VGACONF_LAST,
982648
               "io",
982648
@@ -5106,22 +5107,30 @@ virDomainDefPostParseVideo(virDomainDefPtr def,
982648
     if (def->nvideos == 0)
982648
         return 0;
982648
 
982648
-    virDomainDeviceDef device = {
982648
-        .type = VIR_DOMAIN_DEVICE_VIDEO,
982648
-        .data.video = def->videos[0],
982648
-    };
982648
+    if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_NONE) {
982648
+        /* we don't want to format any values we automatically fill in for
982648
+         * videos into the XML, so clear them
982648
+         */
982648
+        virDomainVideoDefClear(def->videos[0]);
982648
+        def->videos[0]->type = VIR_DOMAIN_VIDEO_TYPE_NONE;
982648
+    } else {
982648
+        virDomainDeviceDef device = {
982648
+            .type = VIR_DOMAIN_DEVICE_VIDEO,
982648
+            .data.video = def->videos[0],
982648
+        };
982648
 
982648
-    /* Mark the first video as primary. If the user specified
982648
-     * primary="yes", the parser already inserted the device at
982648
-     * def->videos[0]
982648
-     */
982648
-    def->videos[0]->primary = true;
982648
+        /* Mark the first video as primary. If the user specified
982648
+         * primary="yes", the parser already inserted the device at
982648
+         * def->videos[0]
982648
+         */
982648
+        def->videos[0]->primary = true;
982648
 
982648
-    /* videos[0] might have been added in AddImplicitDevices, after we've
982648
-     * done the per-device post-parse */
982648
-    if (virDomainDefPostParseDeviceIterator(def, &device,
982648
-                                            NULL, opaque) < 0)
982648
-        return -1;
982648
+        /* videos[0] might have been added in AddImplicitDevices, after we've
982648
+         * done the per-device post-parse */
982648
+        if (virDomainDefPostParseDeviceIterator(def, &device,
982648
+                                                NULL, opaque) < 0)
982648
+            return -1;
982648
+    }
982648
 
982648
     return 0;
982648
 }
982648
@@ -5670,13 +5679,30 @@ virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev)
982648
 
982648
 
982648
 static int
982648
-virDomainVideoDefValidate(const virDomainVideoDef *video)
982648
+virDomainVideoDefValidate(const virDomainVideoDef *video,
982648
+                          const virDomainDef *def)
982648
 {
982648
+    size_t i;
982648
+
982648
     if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) {
982648
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
982648
                        _("missing video model and cannot determine default"));
982648
         return -1;
982648
     }
982648
+
982648
+    /* it doesn't make sense to pair video device type 'none' with any other
982648
+     * types, there can be only a single video device in such case
982648
+     */
982648
+    for (i = 0; i < def->nvideos; i++) {
982648
+        if (def->videos[i]->type == VIR_DOMAIN_VIDEO_TYPE_NONE &&
982648
+            def->nvideos > 1) {
982648
+            virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
982648
+                           _("a '%s' video type must be the only video device "
982648
+                             "defined for the domain"));
982648
+            return -1;
982648
+        }
982648
+    }
982648
+
982648
     return 0;
982648
 }
982648
 
982648
@@ -5738,7 +5764,7 @@ virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev,
982648
         return virDomainHostdevDefValidate(dev->data.hostdev);
982648
 
982648
     case VIR_DOMAIN_DEVICE_VIDEO:
982648
-        return virDomainVideoDefValidate(dev->data.video);
982648
+        return virDomainVideoDefValidate(dev->data.video, def);
982648
 
982648
     case VIR_DOMAIN_DEVICE_MEMORY:
982648
         return virDomainMemoryDefValidate(dev->data.memory);
982648
@@ -15048,6 +15074,7 @@ virDomainVideoDefaultRAM(const virDomainDef *def,
982648
     case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
982648
     case VIR_DOMAIN_VIDEO_TYPE_VIRTIO:
982648
     case VIR_DOMAIN_VIDEO_TYPE_GOP:
982648
+    case VIR_DOMAIN_VIDEO_TYPE_NONE:
982648
     case VIR_DOMAIN_VIDEO_TYPE_LAST:
982648
     default:
982648
         return 0;
982648
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
982648
index 8ca9558ceb..5e2f21dea3 100644
982648
--- a/src/conf/domain_conf.h
982648
+++ b/src/conf/domain_conf.h
982648
@@ -1424,6 +1424,7 @@ typedef enum {
982648
     VIR_DOMAIN_VIDEO_TYPE_PARALLELS, /* pseudo device for VNC in containers */
982648
     VIR_DOMAIN_VIDEO_TYPE_VIRTIO,
982648
     VIR_DOMAIN_VIDEO_TYPE_GOP,
982648
+    VIR_DOMAIN_VIDEO_TYPE_NONE,
982648
 
982648
     VIR_DOMAIN_VIDEO_TYPE_LAST
982648
 } virDomainVideoType;
982648
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
982648
index 1fce45134f..954265feb0 100644
982648
--- a/src/qemu/qemu_command.c
982648
+++ b/src/qemu/qemu_command.c
982648
@@ -105,7 +105,8 @@ VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST,
982648
               "qxl",
982648
               "", /* don't support parallels */
982648
               "", /* no need for virtio */
982648
-              "" /* don't support gop */);
982648
+              "" /* don't support gop */,
982648
+              "" /* 'none' doesn't make sense here */);
982648
 
982648
 VIR_ENUM_DECL(qemuDeviceVideo)
982648
 
982648
@@ -119,7 +120,8 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST,
982648
               "qxl-vga",
982648
               "", /* don't support parallels */
982648
               "virtio-vga",
982648
-              "" /* don't support gop */);
982648
+              "" /* don't support gop */,
982648
+              "" /* 'none' doesn't make sense here */);
982648
 
982648
 VIR_ENUM_DECL(qemuDeviceVideoSecondary)
982648
 
982648
@@ -133,7 +135,8 @@ VIR_ENUM_IMPL(qemuDeviceVideoSecondary, VIR_DOMAIN_VIDEO_TYPE_LAST,
982648
               "qxl",
982648
               "", /* don't support parallels */
982648
               "virtio-gpu",
982648
-              "" /* don't support gop */);
982648
+              "" /* don't support gop */,
982648
+              "" /* 'none' doesn't make sense here */);
982648
 
982648
 VIR_ENUM_DECL(qemuSoundCodec)
982648
 
982648
@@ -4421,6 +4424,9 @@ qemuBuildVideoCommandLine(virCommandPtr cmd,
982648
         char *str = NULL;
982648
         virDomainVideoDefPtr video = def->videos[i];
982648
 
982648
+        if (video->type == VIR_DOMAIN_VIDEO_TYPE_NONE)
982648
+            continue;
982648
+
982648
         if (video->primary) {
982648
             if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY)) {
982648
 
982648
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
982648
index 5337f1ce55..508846116b 100644
982648
--- a/src/qemu/qemu_domain.c
982648
+++ b/src/qemu/qemu_domain.c
982648
@@ -4528,6 +4528,8 @@ static int
982648
 qemuDomainDeviceDefValidateVideo(const virDomainVideoDef *video)
982648
 {
982648
     switch ((virDomainVideoType) video->type) {
982648
+    case VIR_DOMAIN_VIDEO_TYPE_NONE:
982648
+        return 0;
982648
     case VIR_DOMAIN_VIDEO_TYPE_XEN:
982648
     case VIR_DOMAIN_VIDEO_TYPE_VBOX:
982648
     case VIR_DOMAIN_VIDEO_TYPE_PARALLELS:
982648
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
982648
index ab2ac022f1..e6996934b8 100644
982648
--- a/src/qemu/qemu_domain_address.c
982648
+++ b/src/qemu/qemu_domain_address.c
982648
@@ -821,6 +821,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev,
982648
 
982648
         case VIR_DOMAIN_VIDEO_TYPE_DEFAULT:
982648
         case VIR_DOMAIN_VIDEO_TYPE_GOP:
982648
+        case VIR_DOMAIN_VIDEO_TYPE_NONE:
982648
         case VIR_DOMAIN_VIDEO_TYPE_LAST:
982648
             return 0;
982648
         }
982648
@@ -1532,7 +1533,8 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
982648
             goto cleanup;
982648
     }
982648
 
982648
-    if (def->nvideos > 0) {
982648
+    if (def->nvideos > 0 &&
982648
+        def->videos[0]->type != VIR_DOMAIN_VIDEO_TYPE_NONE) {
982648
         /* Because the PIIX3 integrated IDE/USB controllers are
982648
          * already at slot 1, when qemu looks for the first free slot
982648
          * to place the VGA controller (which is always the first
982648
@@ -1540,6 +1542,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def,
982648
          * at slot 2.
982648
          */
982648
         virDomainVideoDefPtr primaryVideo = def->videos[0];
982648
+
982648
         if (virDeviceInfoPCIAddressWanted(&primaryVideo->info)) {
982648
             memset(&tmp_addr, 0, sizeof(tmp_addr));
982648
             tmp_addr.slot = 2;
982648
@@ -2105,6 +2108,8 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
982648
 
982648
     /* Video devices */
982648
     for (i = 0; i < def->nvideos; i++) {
982648
+        if (def->videos[i]->type == VIR_DOMAIN_VIDEO_TYPE_NONE)
982648
+            continue;
982648
 
982648
         if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info))
982648
             continue;
982648
diff --git a/tests/domaincapsschemadata/full.xml b/tests/domaincapsschemadata/full.xml
982648
index 154c4a6fe9..eafba1ae5b 100644
982648
--- a/tests/domaincapsschemadata/full.xml
982648
+++ b/tests/domaincapsschemadata/full.xml
982648
@@ -74,6 +74,7 @@
982648
         <value>parallels</value>
982648
         <value>virtio</value>
982648
         <value>gop</value>
982648
+        <value>none</value>
982648
       </enum>
982648
     </video>
982648
     <hostdev supported='yes'>
982648
diff --git a/tests/qemuxml2argvdata/video-invalid-multiple-devices.xml b/tests/qemuxml2argvdata/video-invalid-multiple-devices.xml
982648
new file mode 100644
982648
index 0000000000..3f105efaae
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/video-invalid-multiple-devices.xml
982648
@@ -0,0 +1,33 @@
982648
+<domain type='qemu'>
982648
+  <name>QEMUGuest1</name>
982648
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
982648
+  <memory unit='KiB'>219100</memory>
982648
+  <currentMemory unit='KiB'>219100</currentMemory>
982648
+  <vcpu placement='static' cpuset='1-4,8-20,525'>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
+      <source dev='/dev/HostVG/QEMUGuest1'/>
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 type='ide' index='0'/>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <video>
982648
+      <model type='qxl'/>
982648
+    </video>
982648
+    <video>
982648
+      <model type='none'/>
982648
+    </video>
982648
+    <memballoon model='virtio'/>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2argvdata/video-none-device.args b/tests/qemuxml2argvdata/video-none-device.args
982648
new file mode 100644
982648
index 0000000000..1b03c0cb97
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/video-none-device.args
982648
@@ -0,0 +1,27 @@
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 QEMUGuest1 \
982648
+-S \
982648
+-machine pc,accel=tcg,usb=off,dump-guest-core=off \
982648
+-m 214 \
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,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
982648
+server,nowait \
982648
+-mon chardev=charmonitor,id=monitor,mode=control \
982648
+-rtc base=utc \
982648
+-no-shutdown \
982648
+-no-acpi \
982648
+-boot c \
982648
+-usb \
982648
+-drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
982648
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
982648
+-vnc 127.0.0.1:0 \
982648
+-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
982648
diff --git a/tests/qemuxml2argvdata/video-none-device.xml b/tests/qemuxml2argvdata/video-none-device.xml
982648
new file mode 100644
982648
index 0000000000..4b591562b7
982648
--- /dev/null
982648
+++ b/tests/qemuxml2argvdata/video-none-device.xml
982648
@@ -0,0 +1,39 @@
982648
+<domain type='qemu'>
982648
+  <name>QEMUGuest1</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
+      <source dev='/dev/HostVG/QEMUGuest1'/>
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
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
982648
+    </controller>
982648
+    <controller type='ide' index='0'>
982648
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
982648
+    </controller>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <input type='mouse' bus='ps2'/>
982648
+    <input type='keyboard' bus='ps2'/>
982648
+    <graphics type='vnc'/>
982648
+    <video>
982648
+      <model type='none'/>
982648
+    </video>
982648
+    <memballoon model='virtio'>
982648
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
982648
+    </memballoon>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
982648
index 9237a4fb89..3cff4ffb5e 100644
982648
--- a/tests/qemuxml2argvtest.c
982648
+++ b/tests/qemuxml2argvtest.c
982648
@@ -1998,7 +1998,9 @@ mymain(void)
982648
             QEMU_CAPS_DEVICE_VIRTIO_VGA,
982648
             QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
982648
             QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS);
982648
-    DO_TEST_PARSE_ERROR("video-invalid", NONE);
982648
+    DO_TEST("video-none-device",
982648
+            QEMU_CAPS_VNC);
982648
+    DO_TEST_PARSE_ERROR("video-invalid-multiple-devices", NONE);
982648
 
982648
     DO_TEST("virtio-rng-default",
982648
             QEMU_CAPS_DEVICE_VIRTIO_RNG,
982648
diff --git a/tests/qemuxml2xmloutdata/video-none-device.xml b/tests/qemuxml2xmloutdata/video-none-device.xml
982648
new file mode 100644
982648
index 0000000000..6e76b394fe
982648
--- /dev/null
982648
+++ b/tests/qemuxml2xmloutdata/video-none-device.xml
982648
@@ -0,0 +1,42 @@
982648
+<domain type='qemu'>
982648
+  <name>QEMUGuest1</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/QEMUGuest1'/>
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
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
982648
+    </controller>
982648
+    <controller type='ide' index='0'>
982648
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
982648
+    </controller>
982648
+    <controller type='pci' index='0' model='pci-root'/>
982648
+    <input type='mouse' bus='ps2'/>
982648
+    <input type='keyboard' bus='ps2'/>
982648
+    <graphics type='vnc' port='-1' autoport='yes'>
982648
+      <listen type='address'/>
982648
+    </graphics>
982648
+    <video>
982648
+      <model type='none'/>
982648
+    </video>
982648
+    <memballoon model='virtio'>
982648
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
982648
+    </memballoon>
982648
+  </devices>
982648
+</domain>
982648
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
982648
index e418e67f6c..e35644d479 100644
982648
--- a/tests/qemuxml2xmltest.c
982648
+++ b/tests/qemuxml2xmltest.c
982648
@@ -1145,6 +1145,7 @@ mymain(void)
982648
             QEMU_CAPS_VIRTIO_GPU_MAX_OUTPUTS,
982648
             QEMU_CAPS_VNC,
982648
             QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW);
982648
+    DO_TEST("video-none-device", NONE);
982648
 
982648
     DO_TEST("intel-iommu",
982648
             QEMU_CAPS_DEVICE_INTEL_IOMMU);
982648
-- 
982648
2.18.0
982648