render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9119d9
From 0c854d5840c6c7546628f578f5c9c3595c9eef60 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <0c854d5840c6c7546628f578f5c9c3595c9eef60@dist-git>
9119d9
From: Pavel Hrdina <phrdina@redhat.com>
9119d9
Date: Tue, 25 Nov 2014 10:53:03 +0100
9119d9
Subject: [PATCH] qemu-command: introduce new vgamem attribute for QXL video
9119d9
 device
9119d9
9119d9
Add attribute to set vgamem_mb parameter of QXL device for QEMU. This
9119d9
value sets the size of VGA framebuffer for QXL device. Default value in
9119d9
QEMU is 8MB so reuse it also in libvirt to not break things.
9119d9
9119d9
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
9119d9
9119d9
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9119d9
(cherry picked from commit 742d49fa170bf72ec1fee516fda9f6797b1124f9)
9119d9
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 docs/formatdomain.html.in                          |  5 ++++-
9119d9
 docs/schemas/domaincommon.rng                      |  5 +++++
9119d9
 src/conf/domain_conf.c                             | 26 ++++++++++++++++++++++
9119d9
 src/conf/domain_conf.h                             |  1 +
9119d9
 src/qemu/qemu_command.c                            | 22 ++++++++++++++++--
9119d9
 src/qemu/qemu_domain.c                             | 19 ++++++++++++++++
9119d9
 .../qemuxml2argv-graphics-spice-compression.xml    |  4 ++--
9119d9
 .../qemuxml2argv-graphics-spice-qxl-vga.xml        |  4 ++--
9119d9
 .../qemuxml2argv-graphics-spice.xml                |  4 ++--
9119d9
 .../qemuxml2argv-pcihole64-q35.xml                 |  2 +-
9119d9
 tests/qemuxml2argvdata/qemuxml2argv-q35.xml        |  2 +-
9119d9
 .../qemuxml2argv-serial-spiceport.xml              |  2 +-
9119d9
 .../qemuxml2argv-video-qxl-device-vgamem.args      |  4 ++--
9119d9
 .../qemuxml2argv-video-qxl-sec-device-vgamem.args  |  6 ++---
9119d9
 tests/qemuxml2argvtest.c                           |  6 +++--
9119d9
 tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml    |  2 +-
9119d9
 16 files changed, 94 insertions(+), 20 deletions(-)
9119d9
9119d9
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
9119d9
index 4755e01..122e21f 100644
9119d9
--- a/docs/formatdomain.html.in
9119d9
+++ b/docs/formatdomain.html.in
9119d9
@@ -4689,7 +4689,10 @@ qemu-kvm -net nic,model=? /dev/null
9119d9
           only and specifies the size of the primary bar, while the optional
9119d9
           attribute vram specifies the secondary bar size.
9119d9
           If "ram" or "vram" are not supplied a default value is used. The ram
9119d9
-          should also be rounded to power of two as vram.
9119d9
+          should also be rounded to power of two as vram. There is also optional
9119d9
+          attribute vgamem (since 1.2.11 (QEMU
9119d9
+          only)) to set the size of VGA framebuffer for fallback mode of
9119d9
+          QXL device.
9119d9
         

9119d9
       
9119d9
 
9119d9
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
9119d9
index 4e917b1..55f49c6 100644
9119d9
--- a/docs/schemas/domaincommon.rng
9119d9
+++ b/docs/schemas/domaincommon.rng
9119d9
@@ -2868,6 +2868,11 @@
9119d9
                   <ref name="unsignedInt"/>
9119d9
                 </attribute>
9119d9
               </optional>
9119d9
+              <optional>
9119d9
+                <attribute name="vgamem">
9119d9
+                  <ref name="unsignedInt"/>
9119d9
+                </attribute>
9119d9
+              </optional>
9119d9
             </group>
9119d9
           </choice>
9119d9
           <optional>
9119d9
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
9119d9
index 0b0200b..09ddc25 100644
9119d9
--- a/src/conf/domain_conf.c
9119d9
+++ b/src/conf/domain_conf.c
9119d9
@@ -10114,6 +10114,7 @@ virDomainVideoDefParseXML(xmlNodePtr node,
9119d9
     char *heads = NULL;
9119d9
     char *vram = NULL;
9119d9
     char *ram = NULL;
9119d9
+    char *vgamem = NULL;
9119d9
     char *primary = NULL;
9119d9
 
9119d9
     if (VIR_ALLOC(def) < 0)
9119d9
@@ -10127,6 +10128,7 @@ virDomainVideoDefParseXML(xmlNodePtr node,
9119d9
                 type = virXMLPropString(cur, "type");
9119d9
                 ram = virXMLPropString(cur, "ram");
9119d9
                 vram = virXMLPropString(cur, "vram");
9119d9
+                vgamem = virXMLPropString(cur, "vgamem");
9119d9
                 heads = virXMLPropString(cur, "heads");
9119d9
 
9119d9
                 if ((primary = virXMLPropString(cur, "primary")) != NULL) {
9119d9
@@ -10180,6 +10182,19 @@ virDomainVideoDefParseXML(xmlNodePtr node,
9119d9
         def->vram = virDomainVideoDefaultRAM(dom, def->type);
9119d9
     }
9119d9
 
9119d9
+    if (vgamem) {
9119d9
+        if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) {
9119d9
+            virReportError(VIR_ERR_XML_ERROR, "%s",
9119d9
+                           _("vgamem attribute only supported for type of qxl"));
9119d9
+            goto error;
9119d9
+        }
9119d9
+        if (virStrToLong_ui(vgamem, NULL, 10, &def->vgamem) < 0) {
9119d9
+            virReportError(VIR_ERR_XML_ERROR,
9119d9
+                           _("cannot parse video vgamem '%s'"), vgamem);
9119d9
+            goto error;
9119d9
+        }
9119d9
+    }
9119d9
+
9119d9
     if (heads) {
9119d9
         if (virStrToLong_ui(heads, NULL, 10, &def->heads) < 0) {
9119d9
             virReportError(VIR_ERR_INTERNAL_ERROR,
9119d9
@@ -10196,6 +10211,7 @@ virDomainVideoDefParseXML(xmlNodePtr node,
9119d9
     VIR_FREE(type);
9119d9
     VIR_FREE(ram);
9119d9
     VIR_FREE(vram);
9119d9
+    VIR_FREE(vgamem);
9119d9
     VIR_FREE(heads);
9119d9
 
9119d9
     return def;
9119d9
@@ -10205,6 +10221,7 @@ virDomainVideoDefParseXML(xmlNodePtr node,
9119d9
     VIR_FREE(type);
9119d9
     VIR_FREE(ram);
9119d9
     VIR_FREE(vram);
9119d9
+    VIR_FREE(vgamem);
9119d9
     VIR_FREE(heads);
9119d9
     return NULL;
9119d9
 }
9119d9
@@ -14528,6 +14545,13 @@ virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src,
9119d9
         return false;
9119d9
     }
9119d9
 
9119d9
+    if (src->vgamem != dst->vgamem) {
9119d9
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
9119d9
+                       _("Target video card vgamem %u does not match source %u"),
9119d9
+                       dst->vgamem, src->vgamem);
9119d9
+        return false;
9119d9
+    }
9119d9
+
9119d9
     if (src->heads != dst->heads) {
9119d9
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
9119d9
                        _("Target video card heads %u does not match source %u"),
9119d9
@@ -17802,6 +17826,8 @@ virDomainVideoDefFormat(virBufferPtr buf,
9119d9
         virBufferAsprintf(buf, " ram='%u'", def->ram);
9119d9
     if (def->vram)
9119d9
         virBufferAsprintf(buf, " vram='%u'", def->vram);
9119d9
+    if (def->vgamem)
9119d9
+        virBufferAsprintf(buf, " vgamem='%u'", def->vgamem);
9119d9
     if (def->heads)
9119d9
         virBufferAsprintf(buf, " heads='%u'", def->heads);
9119d9
     if (def->primary)
9119d9
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
9119d9
index ae46467..04cee80 100644
9119d9
--- a/src/conf/domain_conf.h
9119d9
+++ b/src/conf/domain_conf.h
9119d9
@@ -1284,6 +1284,7 @@ struct _virDomainVideoDef {
9119d9
     int type;
9119d9
     unsigned int ram;  /* kibibytes (multiples of 1024) */
9119d9
     unsigned int vram; /* kibibytes (multiples of 1024) */
9119d9
+    unsigned int vgamem; /* kibibytes (multiples of 1024) */
9119d9
     unsigned int heads;
9119d9
     bool primary;
9119d9
     virDomainVideoAccelDefPtr accel;
9119d9
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
9119d9
index e44f114..70730ce 100644
9119d9
--- a/src/qemu/qemu_command.c
9119d9
+++ b/src/qemu/qemu_command.c
9119d9
@@ -4853,6 +4853,12 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def,
9119d9
             /* QEMU accepts bytes for vram_size. */
9119d9
             virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024);
9119d9
         }
9119d9
+
9119d9
+        if ((primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) ||
9119d9
+            (!primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM))) {
9119d9
+            /* QEMU accepts mebibytes for vgamem_mb. */
9119d9
+            virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024);
9119d9
+        }
9119d9
     } else if (video->vram &&
9119d9
         ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA &&
9119d9
           virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
9119d9
@@ -9139,6 +9145,7 @@ qemuBuildCommandLine(virConnectPtr conn,
9119d9
                     virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) {
9119d9
                     unsigned int ram = def->videos[0]->ram;
9119d9
                     unsigned int vram = def->videos[0]->vram;
9119d9
+                    unsigned int vgamem = def->videos[0]->vgamem;
9119d9
 
9119d9
                     if (vram > (UINT_MAX / 1024)) {
9119d9
                         virReportError(VIR_ERR_OVERFLOW,
9119d9
@@ -9163,6 +9170,12 @@ qemuBuildCommandLine(virConnectPtr conn,
9119d9
                         virCommandAddArgFormat(cmd, "%s.vram_size=%u",
9119d9
                                                dev, vram * 1024);
9119d9
                     }
9119d9
+                    if (vgamem &&
9119d9
+                        virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) {
9119d9
+                        virCommandAddArg(cmd, "-global");
9119d9
+                        virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u",
9119d9
+                                               dev, vgamem / 1024);
9119d9
+                    }
9119d9
                 }
9119d9
 
9119d9
                 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) &&
9119d9
@@ -12169,8 +12182,13 @@ qemuParseCommandLine(virCapsPtr qemuCaps,
9119d9
         else
9119d9
             vid->type = video;
9119d9
         vid->vram = virDomainVideoDefaultRAM(def, vid->type);
9119d9
-        vid->ram = vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL ?
9119d9
-                       virDomainVideoDefaultRAM(def, vid->type) : 0;
9119d9
+        if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
9119d9
+            vid->ram = virDomainVideoDefaultRAM(def, vid->type);
9119d9
+            vid->vgamem = 8 * 1024;
9119d9
+        } else {
9119d9
+            vid->ram = 0;
9119d9
+            vid->vgamem = 0;
9119d9
+        }
9119d9
         vid->heads = 1;
9119d9
 
9119d9
         if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, vid) < 0) {
9119d9
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
9119d9
index d166269..f61593b 100644
9119d9
--- a/src/qemu/qemu_domain.c
9119d9
+++ b/src/qemu/qemu_domain.c
9119d9
@@ -1176,6 +1176,25 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
9119d9
         goto cleanup;
9119d9
     }
9119d9
 
9119d9
+    if (dev->type == VIR_DOMAIN_DEVICE_VIDEO &&
9119d9
+        dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
9119d9
+        if (dev->data.video->vgamem) {
9119d9
+            if (dev->data.video->vgamem < 1024) {
9119d9
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
9119d9
+                               _("value for 'vgamem' must be at least 1 MiB "
9119d9
+                                 "(1024 KiB)"));
9119d9
+                goto cleanup;
9119d9
+            }
9119d9
+            if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) {
9119d9
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
9119d9
+                               _("value for 'vgamem' must be power of two"));
9119d9
+                goto cleanup;
9119d9
+            }
9119d9
+        } else {
9119d9
+            dev->data.video->vgamem = 8 * 1024;
9119d9
+        }
9119d9
+    }
9119d9
+
9119d9
     ret = 0;
9119d9
 
9119d9
  cleanup:
9119d9
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml
9119d9
index 5c9683f..c13327a 100644
9119d9
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml
9119d9
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml
9119d9
@@ -33,10 +33,10 @@
9119d9
       <streaming mode='filter'/>
9119d9
     </graphics>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='32768' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='32768' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <memballoon model='virtio'/>
9119d9
   </devices>
9119d9
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml
9119d9
index acf3019..ac705f3 100644
9119d9
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml
9119d9
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml
9119d9
@@ -30,10 +30,10 @@
9119d9
       <channel name='inputs' mode='insecure'/>
9119d9
     </graphics>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='32768' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='65536' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='65536' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <memballoon model='virtio'/>
9119d9
   </devices>
9119d9
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
9119d9
index 335ce69..0c61ee5 100644
9119d9
--- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
9119d9
+++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml
9119d9
@@ -37,10 +37,10 @@
9119d9
       <filetransfer enable='no'/>
9119d9
     </graphics>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='32768' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='32768' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <memballoon model='virtio'/>
9119d9
   </devices>
9119d9
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml
9119d9
index 168b2701..ef9cd4f 100644
9119d9
--- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml
9119d9
+++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml
9119d9
@@ -26,7 +26,7 @@
9119d9
     <controller type='pci' index='2' model='pci-bridge'/>
9119d9
     <controller type='sata' index='0'/>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='32768' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <memballoon model='none'/>
9119d9
   </devices>
9119d9
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml
9119d9
index 02df713..05967a4 100644
9119d9
--- a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml
9119d9
+++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml
9119d9
@@ -23,7 +23,7 @@
9119d9
     <controller type='pci' index='1' model='dmi-to-pci-bridge'/>
9119d9
     <controller type='pci' index='2' model='pci-bridge'/>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='32768' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <memballoon model='none'/>
9119d9
   </devices>
9119d9
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml
9119d9
index 905924e..1127db1 100644
9119d9
--- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml
9119d9
+++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml
9119d9
@@ -37,7 +37,7 @@
9119d9
       <listen type='address' address='127.0.0.1'/>
9119d9
     </graphics>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='65536' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='65536' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <memballoon model='virtio'/>
9119d9
   </devices>
9119d9
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args
9119d9
index c9eb535..5398ffe 100644
9119d9
--- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args
9119d9
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args
9119d9
@@ -2,5 +2,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
9119d9
 /usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \
9119d9
 -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
9119d9
 -hda /var/lib/libvirt/images/QEMUGuest1 \
9119d9
--device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\
9119d9
-,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
9119d9
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\
9119d9
+,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
9119d9
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args
9119d9
index 5fc41bb..82aa0a9 100644
9119d9
--- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args
9119d9
+++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args
9119d9
@@ -2,7 +2,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \
9119d9
 /usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \
9119d9
 -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \
9119d9
 -hda /var/lib/libvirt/images/QEMUGuest1 \
9119d9
--device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\
9119d9
-,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0\
9119d9
-,addr=0x4 \
9119d9
+-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\
9119d9
+,bus=pci.0,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864\
9119d9
+,vgamem_mb=8,bus=pci.0,addr=0x4 \
9119d9
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
9119d9
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
9119d9
index 24e9740..967760a 100644
9119d9
--- a/tests/qemuxml2argvtest.c
9119d9
+++ b/tests/qemuxml2argvtest.c
9119d9
@@ -1331,13 +1331,15 @@ mymain(void)
9119d9
     DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA,
9119d9
             QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
9119d9
     DO_TEST("video-qxl-device-vgamem", QEMU_CAPS_DEVICE,
9119d9
-            QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
9119d9
+            QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
9119d9
+            QEMU_CAPS_QXL_VGA_VGAMEM);
9119d9
     DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL);
9119d9
     DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA,
9119d9
             QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
9119d9
     DO_TEST("video-qxl-sec-device-vgamem", QEMU_CAPS_DEVICE,
9119d9
             QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL,
9119d9
-            QEMU_CAPS_DEVICE_VIDEO_PRIMARY);
9119d9
+            QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_QXL_VGA_VGAMEM,
9119d9
+            QEMU_CAPS_QXL_VGAMEM);
9119d9
 
9119d9
     DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_RNG,
9119d9
             QEMU_CAPS_OBJECT_RNG_RANDOM);
9119d9
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml
9119d9
index 752c7d5..9dd4162 100644
9119d9
--- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml
9119d9
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml
9119d9
@@ -24,7 +24,7 @@
9119d9
     <controller type='pci' index='2' model='pci-bridge'/>
9119d9
     <controller type='sata' index='0'/>
9119d9
     <video>
9119d9
-      <model type='qxl' ram='65536' vram='32768' heads='1'/>
9119d9
+      <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/>
9119d9
     </video>
9119d9
     <memballoon model='none'/>
9119d9
   </devices>
9119d9
-- 
9119d9
2.1.3
9119d9