diff --git a/0001-Move-virDomainDefPostParseInternal-after-virDomainDe.patch b/0001-Move-virDomainDefPostParseInternal-after-virDomainDe.patch
new file mode 100644
index 0000000..0e74750
--- /dev/null
+++ b/0001-Move-virDomainDefPostParseInternal-after-virDomainDe.patch
@@ -0,0 +1,109 @@
+From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
+Date: Wed, 11 May 2016 11:57:33 +0200
+Subject: [PATCH] Move virDomainDefPostParseInternal after
+ virDomainDeviceDefPostParse
+
+Future commit will call DeviceDefPostParse on a device auto-added
+in DomainDefPostParse.
+
+(cherry picked from commit e4d131b8cb12679814b6fda159281f472b615524)
+---
+ src/conf/domain_conf.c | 78 +++++++++++++++++++++++++-------------------------
+ 1 file changed, 39 insertions(+), 39 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index d93d981..e9206f9 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -3905,45 +3905,6 @@ virDomainDefPostParseTimer(virDomainDefPtr def)
+ }
+ 
+ 
+-static int
+-virDomainDefPostParseInternal(virDomainDefPtr def,
+-                              virCapsPtr caps ATTRIBUTE_UNUSED,
+-                              unsigned int parseFlags)
+-{
+-    /* verify init path for container based domains */
+-    if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
+-        virReportError(VIR_ERR_XML_ERROR, "%s",
+-                       _("init binary must be specified"));
+-        return -1;
+-    }
+-
+-    if (virDomainDefPostParseMemory(def, parseFlags) < 0)
+-        return -1;
+-
+-    if (virDomainDefRejectDuplicateControllers(def) < 0)
+-        return -1;
+-
+-    if (virDomainDefRejectDuplicatePanics(def) < 0)
+-        return -1;
+-
+-    if (virDomainDefPostParseTimer(def) < 0)
+-        return -1;
+-
+-    if (virDomainDefAddImplicitDevices(def) < 0)
+-        return -1;
+-
+-    /* Mark the first video as primary. If the user specified primary="yes",
+-     * the parser already inserted the device at def->videos[0] */
+-    if (def->nvideos != 0)
+-        def->videos[0]->primary = true;
+-
+-    /* clean up possibly duplicated metadata entries */
+-    virDomainDefMetadataSanitize(def);
+-
+-    return 0;
+-}
+-
+-
+ /* Check if a drive type address $controller:$bus:$target:$unit is already
+  * taken by a disk or not.
+  */
+@@ -4358,6 +4319,45 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def ATTRIBUTE_UNUSED,
+ }
+ 
+ 
++static int
++virDomainDefPostParseInternal(virDomainDefPtr def,
++                              virCapsPtr caps ATTRIBUTE_UNUSED,
++                              unsigned int parseFlags)
++{
++    /* verify init path for container based domains */
++    if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
++        virReportError(VIR_ERR_XML_ERROR, "%s",
++                       _("init binary must be specified"));
++        return -1;
++    }
++
++    if (virDomainDefPostParseMemory(def, parseFlags) < 0)
++        return -1;
++
++    if (virDomainDefRejectDuplicateControllers(def) < 0)
++        return -1;
++
++    if (virDomainDefRejectDuplicatePanics(def) < 0)
++        return -1;
++
++    if (virDomainDefPostParseTimer(def) < 0)
++        return -1;
++
++    if (virDomainDefAddImplicitDevices(def) < 0)
++        return -1;
++
++    /* Mark the first video as primary. If the user specified primary="yes",
++     * the parser already inserted the device at def->videos[0] */
++    if (def->nvideos != 0)
++        def->videos[0]->primary = true;
++
++    /* clean up possibly duplicated metadata entries */
++    virDomainDefMetadataSanitize(def);
++
++    return 0;
++}
++
++
+ int
+ virDomainDefPostParse(virDomainDefPtr def,
+                       virCapsPtr caps,
diff --git a/0002-Call-per-device-post-parse-callback-even-on-implicit.patch b/0002-Call-per-device-post-parse-callback-even-on-implicit.patch
new file mode 100644
index 0000000..7e4ca6a
--- /dev/null
+++ b/0002-Call-per-device-post-parse-callback-even-on-implicit.patch
@@ -0,0 +1,86 @@
+From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
+Date: Wed, 11 May 2016 12:13:51 +0200
+Subject: [PATCH] Call per-device post-parse callback even on implicit video
+
+Commit 6879be48 moved adding of an implicit video device after XML
+parsing. As a result, libxlDomainDeviceDefPostParse() is no longer
+called to set the default vram when adding an implicit device.
+Commit 6879be48 assumes virDomainVideoDefaultRAM() will set the
+default vram, but it returns 0 if the domain virtType is
+VIR_DOMAIN_VIRT_XEN. Attempting to start an HVM domain with vram=0
+results in
+
+error: unsupported configuration: videoram must be at least 4MB for CIRRUS
+
+The default vram setting for Xen HVM domains depends on the device
+model used (qemu-xen vs qemu-traditional), hence setting the
+default is deferred to libxlDomainDeviceDefPostParse().
+
+Call the device post-parse callback even for implicit video,
+to fill out the default vram even for VIR_DOMAIN_VIRT_XEN.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1334557
+Most-of-commit-message-by: Jim Fehlig <jfehlig@suse.com>
+(cherry picked from commit 3e4286703273b06a21ae07f3e76a66f9661199dc)
+---
+ src/conf/domain_conf.c | 24 +++++++++++++++++-------
+ 1 file changed, 17 insertions(+), 7 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index e9206f9..aa0268b 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -4321,8 +4321,7 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def ATTRIBUTE_UNUSED,
+ 
+ static int
+ virDomainDefPostParseInternal(virDomainDefPtr def,
+-                              virCapsPtr caps ATTRIBUTE_UNUSED,
+-                              unsigned int parseFlags)
++                              struct virDomainDefPostParseDeviceIteratorData *data)
+ {
+     /* verify init path for container based domains */
+     if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
+@@ -4331,7 +4330,7 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
+         return -1;
+     }
+ 
+-    if (virDomainDefPostParseMemory(def, parseFlags) < 0)
++    if (virDomainDefPostParseMemory(def, data->parseFlags) < 0)
+         return -1;
+ 
+     if (virDomainDefRejectDuplicateControllers(def) < 0)
+@@ -4346,11 +4345,22 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
+     if (virDomainDefAddImplicitDevices(def) < 0)
+         return -1;
+ 
+-    /* Mark the first video as primary. If the user specified primary="yes",
+-     * the parser already inserted the device at def->videos[0] */
+-    if (def->nvideos != 0)
++    if (def->nvideos != 0) {
++        virDomainDeviceDef device = {
++            .type = VIR_DOMAIN_DEVICE_VIDEO,
++            .data.video = def->videos[0],
++        };
++
++        /* Mark the first video as primary. If the user specified primary="yes",
++         * the parser already inserted the device at def->videos[0] */
+         def->videos[0]->primary = true;
+ 
++        /* videos[0] might have been added in AddImplicitDevices, after we've
++         * done the per-device post-parse */
++        if (virDomainDefPostParseDeviceIterator(NULL, &device, NULL, data) < 0)
++            return -1;
++    }
++
+     /* clean up possibly duplicated metadata entries */
+     virDomainDefMetadataSanitize(def);
+ 
+@@ -4388,7 +4398,7 @@ virDomainDefPostParse(virDomainDefPtr def,
+         return ret;
+ 
+ 
+-    if ((ret = virDomainDefPostParseInternal(def, caps, parseFlags)) < 0)
++    if ((ret = virDomainDefPostParseInternal(def, &data)) < 0)
+         return ret;
+ 
+     if (virDomainDefPostParseCheckFeatures(def, xmlopt) < 0)
diff --git a/0003-Fill-out-default-vram-in-DeviceDefPostParse.patch b/0003-Fill-out-default-vram-in-DeviceDefPostParse.patch
new file mode 100644
index 0000000..b091267
--- /dev/null
+++ b/0003-Fill-out-default-vram-in-DeviceDefPostParse.patch
@@ -0,0 +1,85 @@
+From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
+Date: Wed, 11 May 2016 12:39:52 +0200
+Subject: [PATCH] Fill out default vram in DeviceDefPostParse
+
+Move filling out the default video (v)ram to DeviceDefPostParse.
+
+This means it can be removed from virDomainVideoDefParseXML
+and qemuParseCommandLine. Also, we no longer need to special case
+VIR_DOMAIN_VIRT_XEN, since the per-driver callback gets called
+before the generic one.
+
+(cherry picked from commit 538012c8a30230065d1bfe09892279dd8b89193f)
+---
+ src/conf/domain_conf.c        | 15 ++++++---------
+ src/qemu/qemu_parse_command.c |  2 --
+ 2 files changed, 6 insertions(+), 11 deletions(-)
+
+diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
+index aa0268b..7a0b8c5 100644
+--- a/src/conf/domain_conf.c
++++ b/src/conf/domain_conf.c
+@@ -4155,6 +4155,12 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev,
+ 
+     if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) {
+         virDomainVideoDefPtr video = dev->data.video;
++        /* Fill out (V)RAM if the driver-specific callback did not do so */
++        if (video->ram == 0 && video->type == VIR_DOMAIN_VIDEO_TYPE_QXL)
++            video->ram = virDomainVideoDefaultRAM(def, video->type);
++        if (video->vram == 0)
++            video->vram = virDomainVideoDefaultRAM(def, video->type);
++
+         video->ram = VIR_ROUND_UP_POWER_OF_TWO(video->ram);
+         video->vram = VIR_ROUND_UP_POWER_OF_TWO(video->vram);
+     }
+@@ -11970,10 +11976,6 @@ unsigned int
+ virDomainVideoDefaultRAM(const virDomainDef *def,
+                          const virDomainVideoType type)
+ {
+-    /* Defer setting default vram to the Xen drivers */
+-    if (def->virtType == VIR_DOMAIN_VIRT_XEN)
+-        return 0;
+-
+     switch (type) {
+     case VIR_DOMAIN_VIDEO_TYPE_VGA:
+     case VIR_DOMAIN_VIDEO_TYPE_CIRRUS:
+@@ -12152,8 +12154,6 @@ virDomainVideoDefParseXML(xmlNodePtr node,
+                            _("cannot parse video ram '%s'"), ram);
+             goto error;
+         }
+-    } else if (def->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
+-        def->ram = virDomainVideoDefaultRAM(dom, def->type);
+     }
+ 
+     if (vram) {
+@@ -12162,8 +12162,6 @@ virDomainVideoDefParseXML(xmlNodePtr node,
+                            _("cannot parse video vram '%s'"), vram);
+             goto error;
+         }
+-    } else {
+-        def->vram = virDomainVideoDefaultRAM(dom, def->type);
+     }
+ 
+     if (vram64) {
+@@ -18612,7 +18610,6 @@ virDomainDefAddImplicitVideo(virDomainDefPtr def)
+                        _("cannot determine default video type"));
+         goto cleanup;
+     }
+-    video->vram = virDomainVideoDefaultRAM(def, video->type);
+     video->heads = 1;
+     if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, video) < 0)
+         goto cleanup;
+diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c
+index 79f5b92..6dc597a 100644
+--- a/src/qemu/qemu_parse_command.c
++++ b/src/qemu/qemu_parse_command.c
+@@ -2585,9 +2585,7 @@ qemuParseCommandLine(virCapsPtr caps,
+             vid->type = VIR_DOMAIN_VIDEO_TYPE_XEN;
+         else
+             vid->type = video;
+-        vid->vram = virDomainVideoDefaultRAM(def, vid->type);
+         if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) {
+-            vid->ram = virDomainVideoDefaultRAM(def, vid->type);
+             vid->vgamem = QEMU_QXL_VGAMEM_DEFAULT;
+         } else {
+             vid->ram = 0;
diff --git a/0004-Fix-tests-to-include-video-ram-size.patch b/0004-Fix-tests-to-include-video-ram-size.patch
new file mode 100644
index 0000000..f07ea83
--- /dev/null
+++ b/0004-Fix-tests-to-include-video-ram-size.patch
@@ -0,0 +1,1033 @@
+From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
+Date: Thu, 12 May 2016 14:19:52 +0200
+Subject: [PATCH] Fix tests to include video ram size
+
+My commit 3e42867 started filling out the video size in post-parse,
+but did not adjust the tests.
+
+(cherry picked from commit 96b21fb0ecf8242ceb298607da61b5718511a388)
+---
+ tests/sexpr2xmldata/sexpr2xml-curmem.xml                            | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml                       | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml                   | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml                     | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml                   | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml                      | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml                   | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml                   | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml             | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml            | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml                    | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml                    | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml                    | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml                     | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml                   | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml              | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml                     | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml                     | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml                    | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml                      | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-sound.xml                          | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml                       | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml                      | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-utc.xml                            | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv-v2.xml                             | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-fv.xml                                | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml                   | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml             | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml                        | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml                 | 2 +-
+ tests/sexpr2xmldata/sexpr2xml-vif-rate.xml                          | 2 +-
+ tests/xlconfigdata/test-disk-positional-parms-full.xml              | 2 +-
+ tests/xlconfigdata/test-disk-positional-parms-partial.xml           | 2 +-
+ tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.xml | 2 +-
+ tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.xml       | 2 +-
+ tests/xlconfigdata/test-fullvirt-direct-kernel-boot.xml             | 2 +-
+ tests/xlconfigdata/test-fullvirt-multiusb.xml                       | 2 +-
+ tests/xlconfigdata/test-fullvirt-nohap.xml                          | 2 +-
+ tests/xlconfigdata/test-new-disk.xml                                | 2 +-
+ tests/xlconfigdata/test-rbd-multihost-noauth.xml                    | 2 +-
+ tests/xlconfigdata/test-spice-features.xml                          | 2 +-
+ tests/xlconfigdata/test-spice.xml                                   | 2 +-
+ tests/xlconfigdata/test-vif-rate.xml                                | 2 +-
+ tests/xmconfigdata/test-escape-paths.xml                            | 2 +-
+ tests/xmconfigdata/test-fullvirt-default-feature.xml                | 2 +-
+ tests/xmconfigdata/test-fullvirt-force-hpet.xml                     | 2 +-
+ tests/xmconfigdata/test-fullvirt-force-nohpet.xml                   | 2 +-
+ tests/xmconfigdata/test-fullvirt-localtime.xml                      | 2 +-
+ tests/xmconfigdata/test-fullvirt-net-netfront.xml                   | 2 +-
+ tests/xmconfigdata/test-fullvirt-new-cdrom.xml                      | 2 +-
+ tests/xmconfigdata/test-fullvirt-nohap.xml                          | 2 +-
+ tests/xmconfigdata/test-fullvirt-parallel-tcp.xml                   | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml             | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml            | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-file.xml                    | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-null.xml                    | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-pipe.xml                    | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-pty.xml                     | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-stdio.xml                   | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml              | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-tcp.xml                     | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-udp.xml                     | 2 +-
+ tests/xmconfigdata/test-fullvirt-serial-unix.xml                    | 2 +-
+ tests/xmconfigdata/test-fullvirt-sound.xml                          | 2 +-
+ tests/xmconfigdata/test-fullvirt-usbmouse.xml                       | 2 +-
+ tests/xmconfigdata/test-fullvirt-usbtablet.xml                      | 2 +-
+ tests/xmconfigdata/test-fullvirt-utc.xml                            | 2 +-
+ tests/xmconfigdata/test-no-source-cdrom.xml                         | 2 +-
+ tests/xmconfigdata/test-paravirt-net-e1000.xml                      | 2 +-
+ tests/xmconfigdata/test-paravirt-net-vifname.xml                    | 2 +-
+ tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml            | 2 +-
+ tests/xmconfigdata/test-paravirt-new-pvfb.xml                       | 2 +-
+ tests/xmconfigdata/test-pci-devs.xml                                | 2 +-
+ 73 files changed, 73 insertions(+), 73 deletions(-)
+
+diff --git a/tests/sexpr2xmldata/sexpr2xml-curmem.xml b/tests/sexpr2xmldata/sexpr2xml-curmem.xml
+index a2668d1..6932e33 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-curmem.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-curmem.xml
+@@ -35,7 +35,7 @@
+     <input type='keyboard' bus='xen'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='xen' heads='1' primary='yes'/>
++      <model type='xen' vram='4096' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml
+index c4b22f6..fdd7c7d 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-autoport.xml
+@@ -51,7 +51,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='5925' autoport='yes' keymap='en-us'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml b/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml
+index 17d4016..42d529c 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-empty-kernel.xml
+@@ -44,7 +44,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml
+index 20a0d76..5e26804 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-force-hpet.xml
+@@ -47,7 +47,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml
+index 13fb299..f6af578 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-force-nohpet.xml
+@@ -47,7 +47,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml b/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml
+index 1380426..aba6045 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-localtime.xml
+@@ -44,7 +44,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml b/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml
+index 64111fe..22e2035 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-net-netfront.xml
+@@ -45,7 +45,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml
+index f362aee..aa5122b 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-parallel-tcp.xml
+@@ -49,7 +49,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml
+index 4d3bdde..bcccb94 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2-ports.xml
+@@ -56,7 +56,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml
+index d3eaf82..82c41a6 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-dev-2nd-port.xml
+@@ -52,7 +52,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml
+index 0f209d6..062f349 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-file.xml
+@@ -52,7 +52,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml
+index b157f63..38a2fb3 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-null.xml
+@@ -50,7 +50,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml
+index d9cd840..4d76e34 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pipe.xml
+@@ -52,7 +52,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml
+index 2cffa65..e0f90ef 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-pty.xml
+@@ -50,7 +50,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml
+index 6e473d4..7de5731 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-stdio.xml
+@@ -50,7 +50,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml
+index f03bd29..c22e2a5 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp-telnet.xml
+@@ -54,7 +54,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml
+index 2e9c629..439a66e 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-tcp.xml
+@@ -54,7 +54,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml
+index 3f3f676..b4bdc8a 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-udp.xml
+@@ -54,7 +54,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml
+index 4f28511..af9f928 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-serial-unix.xml
+@@ -52,7 +52,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml b/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml
+index f934a85..d0240c4 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-sound-all.xml
+@@ -46,7 +46,7 @@
+     <sound model='sb16'/>
+     <sound model='es1370'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml b/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml
+index f934a85..d0240c4 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-sound.xml
+@@ -46,7 +46,7 @@
+     <sound model='sb16'/>
+     <sound model='es1370'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml b/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml
+index 8b5887e..e84e172 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-usbmouse.xml
+@@ -45,7 +45,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml b/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml
+index 3e4b366..187d867 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-usbtablet.xml
+@@ -45,7 +45,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml b/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml
+index 9c2b9e3..2816f4a 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-utc.xml
+@@ -44,7 +44,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml
+index 9c2b9e3..2816f4a 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv-v2.xml
+@@ -44,7 +44,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-fv.xml b/tests/sexpr2xmldata/sexpr2xml-fv.xml
+index 9c2b9e3..2816f4a 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-fv.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-fv.xml
+@@ -44,7 +44,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
+index 97d9482..41fb3b7 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-no-source-cdrom.xml
+@@ -49,7 +49,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml
+index dbdacf9..72fec25 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new-vncdisplay.xml
+@@ -30,7 +30,7 @@
+       <listen type='address' address='0.0.0.0'/>
+     </graphics>
+     <video>
+-      <model type='xen' heads='1' primary='yes'/>
++      <model type='xen' vram='4096' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
+index c415aab..0fd7a88 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-new.xml
+@@ -30,7 +30,7 @@
+       <listen type='address' address='0.0.0.0'/>
+     </graphics>
+     <video>
+-      <model type='xen' heads='1' primary='yes'/>
++      <model type='xen' vram='4096' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml
+index c1acba1..ee24536 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-pv-vfb-type-crash.xml
+@@ -33,7 +33,7 @@
+     <input type='keyboard' bus='xen'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='xen' heads='1' primary='yes'/>
++      <model type='xen' vram='4096' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/sexpr2xmldata/sexpr2xml-vif-rate.xml b/tests/sexpr2xmldata/sexpr2xml-vif-rate.xml
+index 45887e5..1ebd5f0 100644
+--- a/tests/sexpr2xmldata/sexpr2xml-vif-rate.xml
++++ b/tests/sexpr2xmldata/sexpr2xml-vif-rate.xml
+@@ -48,7 +48,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xlconfigdata/test-disk-positional-parms-full.xml b/tests/xlconfigdata/test-disk-positional-parms-full.xml
+index 3d4868c..41e8804 100644
+--- a/tests/xlconfigdata/test-disk-positional-parms-full.xml
++++ b/tests/xlconfigdata/test-disk-positional-parms-full.xml
+@@ -52,7 +52,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-disk-positional-parms-partial.xml b/tests/xlconfigdata/test-disk-positional-parms-partial.xml
+index 402f479..6578e59 100644
+--- a/tests/xlconfigdata/test-disk-positional-parms-partial.xml
++++ b/tests/xlconfigdata/test-disk-positional-parms-partial.xml
+@@ -52,7 +52,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.xml b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.xml
+index 686a409..3738c8e 100644
+--- a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.xml
++++ b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-bogus-extra.xml
+@@ -49,7 +49,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.xml b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.xml
+index 686a409..3738c8e 100644
+--- a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.xml
++++ b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot-extra.xml
+@@ -49,7 +49,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.xml b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.xml
+index 686a409..3738c8e 100644
+--- a/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.xml
++++ b/tests/xlconfigdata/test-fullvirt-direct-kernel-boot.xml
+@@ -49,7 +49,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-fullvirt-multiusb.xml b/tests/xlconfigdata/test-fullvirt-multiusb.xml
+index 5ec72c4..d7df23a 100644
+--- a/tests/xlconfigdata/test-fullvirt-multiusb.xml
++++ b/tests/xlconfigdata/test-fullvirt-multiusb.xml
+@@ -48,7 +48,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-fullvirt-nohap.xml b/tests/xlconfigdata/test-fullvirt-nohap.xml
+index a997c7a..9cd7b0b 100644
+--- a/tests/xlconfigdata/test-fullvirt-nohap.xml
++++ b/tests/xlconfigdata/test-fullvirt-nohap.xml
+@@ -56,7 +56,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-new-disk.xml b/tests/xlconfigdata/test-new-disk.xml
+index 3d4868c..41e8804 100644
+--- a/tests/xlconfigdata/test-new-disk.xml
++++ b/tests/xlconfigdata/test-new-disk.xml
+@@ -52,7 +52,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-rbd-multihost-noauth.xml b/tests/xlconfigdata/test-rbd-multihost-noauth.xml
+index f8f663f..728aa1e 100644
+--- a/tests/xlconfigdata/test-rbd-multihost-noauth.xml
++++ b/tests/xlconfigdata/test-rbd-multihost-noauth.xml
+@@ -49,7 +49,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-spice-features.xml b/tests/xlconfigdata/test-spice-features.xml
+index f9eb857..3820732 100644
+--- a/tests/xlconfigdata/test-spice-features.xml
++++ b/tests/xlconfigdata/test-spice-features.xml
+@@ -48,7 +48,7 @@
+       <clipboard copypaste='yes'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-spice.xml b/tests/xlconfigdata/test-spice.xml
+index fc2fa3f..f33691f 100644
+--- a/tests/xlconfigdata/test-spice.xml
++++ b/tests/xlconfigdata/test-spice.xml
+@@ -48,7 +48,7 @@
+       <clipboard copypaste='no'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xlconfigdata/test-vif-rate.xml b/tests/xlconfigdata/test-vif-rate.xml
+index 0e13f2e..3620e2a 100644
+--- a/tests/xlconfigdata/test-vif-rate.xml
++++ b/tests/xlconfigdata/test-vif-rate.xml
+@@ -55,7 +55,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='8192' heads='1' primary='yes'/>
+     </video>
+   </devices>
+ </domain>
+diff --git a/tests/xmconfigdata/test-escape-paths.xml b/tests/xmconfigdata/test-escape-paths.xml
+index 6373fdf..a5daa2c 100644
+--- a/tests/xmconfigdata/test-escape-paths.xml
++++ b/tests/xmconfigdata/test-escape-paths.xml
+@@ -54,7 +54,7 @@
+     <sound model='sb16'/>
+     <sound model='es1370'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-default-feature.xml b/tests/xmconfigdata/test-fullvirt-default-feature.xml
+index 6f4dae6..ce1280d 100644
+--- a/tests/xmconfigdata/test-fullvirt-default-feature.xml
++++ b/tests/xmconfigdata/test-fullvirt-default-feature.xml
+@@ -48,7 +48,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-force-hpet.xml b/tests/xmconfigdata/test-fullvirt-force-hpet.xml
+index 6f4dae6..ce1280d 100644
+--- a/tests/xmconfigdata/test-fullvirt-force-hpet.xml
++++ b/tests/xmconfigdata/test-fullvirt-force-hpet.xml
+@@ -48,7 +48,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-force-nohpet.xml b/tests/xmconfigdata/test-fullvirt-force-nohpet.xml
+index 6015405..7636f31 100644
+--- a/tests/xmconfigdata/test-fullvirt-force-nohpet.xml
++++ b/tests/xmconfigdata/test-fullvirt-force-nohpet.xml
+@@ -48,7 +48,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-localtime.xml b/tests/xmconfigdata/test-fullvirt-localtime.xml
+index 5f81e25..b3adf86 100644
+--- a/tests/xmconfigdata/test-fullvirt-localtime.xml
++++ b/tests/xmconfigdata/test-fullvirt-localtime.xml
+@@ -46,7 +46,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-net-netfront.xml b/tests/xmconfigdata/test-fullvirt-net-netfront.xml
+index cb0615b..c22ad8d 100644
+--- a/tests/xmconfigdata/test-fullvirt-net-netfront.xml
++++ b/tests/xmconfigdata/test-fullvirt-net-netfront.xml
+@@ -46,7 +46,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml
+index d29892e..2bb3d72 100644
+--- a/tests/xmconfigdata/test-fullvirt-new-cdrom.xml
++++ b/tests/xmconfigdata/test-fullvirt-new-cdrom.xml
+@@ -46,7 +46,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-nohap.xml b/tests/xmconfigdata/test-fullvirt-nohap.xml
+index f38366c..234856c 100644
+--- a/tests/xmconfigdata/test-fullvirt-nohap.xml
++++ b/tests/xmconfigdata/test-fullvirt-nohap.xml
+@@ -47,7 +47,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml b/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml
+index 3269aee..be149fd 100644
+--- a/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml
++++ b/tests/xmconfigdata/test-fullvirt-parallel-tcp.xml
+@@ -51,7 +51,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml b/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml
+index a20d6c8..753043d 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-dev-2-ports.xml
+@@ -58,7 +58,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml b/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml
+index 8344da3..a104c6f 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-dev-2nd-port.xml
+@@ -54,7 +54,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-file.xml b/tests/xmconfigdata/test-fullvirt-serial-file.xml
+index b9439d7..f27aba9 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-file.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-file.xml
+@@ -54,7 +54,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-null.xml b/tests/xmconfigdata/test-fullvirt-serial-null.xml
+index 6e8196b..ea29944 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-null.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-null.xml
+@@ -52,7 +52,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml
+index da0c9bd..69bf51c 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-pipe.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-pipe.xml
+@@ -54,7 +54,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-pty.xml b/tests/xmconfigdata/test-fullvirt-serial-pty.xml
+index acff588..0c6e477 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-pty.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-pty.xml
+@@ -52,7 +52,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml
+index 6909053..1f12081 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-stdio.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-stdio.xml
+@@ -52,7 +52,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
+index a3fd449..47544df 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-tcp-telnet.xml
+@@ -56,7 +56,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml
+index 9dba76d..8f1777a 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-tcp.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-tcp.xml
+@@ -56,7 +56,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-udp.xml b/tests/xmconfigdata/test-fullvirt-serial-udp.xml
+index 3577f92..c59e2b6 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-udp.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-udp.xml
+@@ -56,7 +56,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-serial-unix.xml b/tests/xmconfigdata/test-fullvirt-serial-unix.xml
+index 919108b..e678786 100644
+--- a/tests/xmconfigdata/test-fullvirt-serial-unix.xml
++++ b/tests/xmconfigdata/test-fullvirt-serial-unix.xml
+@@ -54,7 +54,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-sound.xml b/tests/xmconfigdata/test-fullvirt-sound.xml
+index 0e85953..3bd2e76 100644
+--- a/tests/xmconfigdata/test-fullvirt-sound.xml
++++ b/tests/xmconfigdata/test-fullvirt-sound.xml
+@@ -48,7 +48,7 @@
+     <sound model='sb16'/>
+     <sound model='es1370'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-usbmouse.xml b/tests/xmconfigdata/test-fullvirt-usbmouse.xml
+index 8eb5aa5..f1421b6 100644
+--- a/tests/xmconfigdata/test-fullvirt-usbmouse.xml
++++ b/tests/xmconfigdata/test-fullvirt-usbmouse.xml
+@@ -47,7 +47,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-usbtablet.xml b/tests/xmconfigdata/test-fullvirt-usbtablet.xml
+index dcdd951..566c842 100644
+--- a/tests/xmconfigdata/test-fullvirt-usbtablet.xml
++++ b/tests/xmconfigdata/test-fullvirt-usbtablet.xml
+@@ -47,7 +47,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-fullvirt-utc.xml b/tests/xmconfigdata/test-fullvirt-utc.xml
+index d29892e..2bb3d72 100644
+--- a/tests/xmconfigdata/test-fullvirt-utc.xml
++++ b/tests/xmconfigdata/test-fullvirt-utc.xml
+@@ -46,7 +46,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-no-source-cdrom.xml b/tests/xmconfigdata/test-no-source-cdrom.xml
+index d4c2fd6..246123c 100644
+--- a/tests/xmconfigdata/test-no-source-cdrom.xml
++++ b/tests/xmconfigdata/test-no-source-cdrom.xml
+@@ -49,7 +49,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-paravirt-net-e1000.xml b/tests/xmconfigdata/test-paravirt-net-e1000.xml
+index ad44d11..735e8b0 100644
+--- a/tests/xmconfigdata/test-paravirt-net-e1000.xml
++++ b/tests/xmconfigdata/test-paravirt-net-e1000.xml
+@@ -33,7 +33,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='xen' heads='1' primary='yes'/>
++      <model type='xen' vram='4096' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-paravirt-net-vifname.xml b/tests/xmconfigdata/test-paravirt-net-vifname.xml
+index e94b685..3ce3639 100644
+--- a/tests/xmconfigdata/test-paravirt-net-vifname.xml
++++ b/tests/xmconfigdata/test-paravirt-net-vifname.xml
+@@ -34,7 +34,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='xen' heads='1' primary='yes'/>
++      <model type='xen' vram='4096' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml
+index 3ca3023..20c31ec 100644
+--- a/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml
++++ b/tests/xmconfigdata/test-paravirt-new-pvfb-vncdisplay.xml
+@@ -32,7 +32,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='xen' heads='1' primary='yes'/>
++      <model type='xen' vram='4096' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-paravirt-new-pvfb.xml b/tests/xmconfigdata/test-paravirt-new-pvfb.xml
+index d97799a..33c48f4 100644
+--- a/tests/xmconfigdata/test-paravirt-new-pvfb.xml
++++ b/tests/xmconfigdata/test-paravirt-new-pvfb.xml
+@@ -32,7 +32,7 @@
+       <listen type='address' address='127.0.0.1'/>
+     </graphics>
+     <video>
+-      <model type='xen' heads='1' primary='yes'/>
++      <model type='xen' vram='4096' heads='1' primary='yes'/>
+     </video>
+     <memballoon model='xen'/>
+   </devices>
+diff --git a/tests/xmconfigdata/test-pci-devs.xml b/tests/xmconfigdata/test-pci-devs.xml
+index 4c3f5f2..a88853d 100644
+--- a/tests/xmconfigdata/test-pci-devs.xml
++++ b/tests/xmconfigdata/test-pci-devs.xml
+@@ -49,7 +49,7 @@
+     <input type='keyboard' bus='ps2'/>
+     <graphics type='vnc' port='-1' autoport='yes'/>
+     <video>
+-      <model type='cirrus' heads='1' primary='yes'/>
++      <model type='cirrus' vram='16384' heads='1' primary='yes'/>
+     </video>
+     <hostdev mode='subsystem' type='pci' managed='no'>
+       <source>
diff --git a/0005-libxl-don-t-attempt-to-probe-a-non-existent-emulator.patch b/0005-libxl-don-t-attempt-to-probe-a-non-existent-emulator.patch
new file mode 100644
index 0000000..4abc3ca
--- /dev/null
+++ b/0005-libxl-don-t-attempt-to-probe-a-non-existent-emulator.patch
@@ -0,0 +1,39 @@
+From: Jim Fehlig <jfehlig@suse.com>
+Date: Thu, 12 May 2016 14:40:28 -0600
+Subject: [PATCH] libxl: don't attempt to probe a non-existent emulator
+
+When probing the <emulator> with '-help' to determine if
+it is the old qemu, errors are reported if the emulator
+doesn't exist
+
+libvirt:  error : internal error: Child process
+(/usr/lib/xen/bin/qemu-dm -help) unexpected exit status 127:
+libvirt:  error : cannot execute binary /usr/lib/xen/bin/qemu-dm:
+No such file or directory
+
+Avoid the probe if the specified emulator doesn't exist,
+squelching the error. There is no behavior change since
+libxlDomainGetEmulatorType() would return
+LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN if the probe failed
+via virCommandRun().
+
+Signed-off-by: Jim Fehlig <jfehlig@suse.com>
+(cherry picked from commit 400e716d7d8371fa718c27bb4f05b9a68929e64a)
+---
+ src/libxl/libxl_conf.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
+index 30f2ce9..bcbb773 100644
+--- a/src/libxl/libxl_conf.c
++++ b/src/libxl/libxl_conf.c
+@@ -916,6 +916,9 @@ libxlDomainGetEmulatorType(const virDomainDef *def)
+ 
+     if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
+         if (def->emulator) {
++            if (!virFileExists(def->emulator))
++                goto cleanup;
++
+             cmd = virCommandNew(def->emulator);
+ 
+             virCommandAddArgList(cmd, "-help", NULL);
diff --git a/0006-xlconfigtests-use-qemu-xen-in-all-test-data-files.patch b/0006-xlconfigtests-use-qemu-xen-in-all-test-data-files.patch
new file mode 100644
index 0000000..e2cb437
--- /dev/null
+++ b/0006-xlconfigtests-use-qemu-xen-in-all-test-data-files.patch
@@ -0,0 +1,276 @@
+From: Jim Fehlig <jfehlig@suse.com>
+Date: Thu, 12 May 2016 14:40:29 -0600
+Subject: [PATCH] xlconfigtests: use qemu-xen in all test data files
+
+Some of the test configuration files in tests/xlconfigdata
+use the old qemu-dm as the emulator. Many of the configuration
+features tested (spice, rbd, multi-usb) are not even usable with
+the old qemu. Change these files to use the new qemu-xen (also
+known as qemu upstream) emulator.
+
+Note: This change fixes xlconfigtest failures when the old
+qemu is actually installed on the system. During device post
+parse, the libxl driver attempts to invoke the emulator to
+determine if it is the old or new qemu so it can properly set
+video RAM defaults. With the old qemu installed, the default
+video RAM was set differently than the expected value.
+Changing all the test data files to use qemu-xen ensures
+predictable results wrt default video RAM size.
+
+Signed-off-by: Jim Fehlig <jfehlig@suse.com>
+(cherry picked from commit b90c4b5f505698d600303c5b4f03f5d229b329dd)
+---
+ tests/xlconfigdata/test-disk-positional-parms-full.cfg    | 2 +-
+ tests/xlconfigdata/test-disk-positional-parms-full.xml    | 2 +-
+ tests/xlconfigdata/test-disk-positional-parms-partial.cfg | 2 +-
+ tests/xlconfigdata/test-disk-positional-parms-partial.xml | 2 +-
+ tests/xlconfigdata/test-fullvirt-multiusb.cfg             | 2 +-
+ tests/xlconfigdata/test-fullvirt-multiusb.xml             | 2 +-
+ tests/xlconfigdata/test-fullvirt-nohap.cfg                | 2 +-
+ tests/xlconfigdata/test-fullvirt-nohap.xml                | 2 +-
+ tests/xlconfigdata/test-new-disk.cfg                      | 2 +-
+ tests/xlconfigdata/test-new-disk.xml                      | 2 +-
+ tests/xlconfigdata/test-rbd-multihost-noauth.cfg          | 2 +-
+ tests/xlconfigdata/test-rbd-multihost-noauth.xml          | 2 +-
+ tests/xlconfigdata/test-spice-features.cfg                | 2 +-
+ tests/xlconfigdata/test-spice-features.xml                | 2 +-
+ tests/xlconfigdata/test-spice.cfg                         | 2 +-
+ tests/xlconfigdata/test-spice.xml                         | 2 +-
+ tests/xlconfigdata/test-vif-rate.cfg                      | 2 +-
+ tests/xlconfigdata/test-vif-rate.xml                      | 2 +-
+ 18 files changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/tests/xlconfigdata/test-disk-positional-parms-full.cfg b/tests/xlconfigdata/test-disk-positional-parms-full.cfg
+index c5bbb03..217d4dc 100644
+--- a/tests/xlconfigdata/test-disk-positional-parms-full.cfg
++++ b/tests/xlconfigdata/test-disk-positional-parms-full.cfg
+@@ -12,7 +12,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ sdl = 0
+ vnc = 1
+ vncunused = 1
+diff --git a/tests/xlconfigdata/test-disk-positional-parms-full.xml b/tests/xlconfigdata/test-disk-positional-parms-full.xml
+index 41e8804..1bc5b43 100644
+--- a/tests/xlconfigdata/test-disk-positional-parms-full.xml
++++ b/tests/xlconfigdata/test-disk-positional-parms-full.xml
+@@ -19,7 +19,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
+diff --git a/tests/xlconfigdata/test-disk-positional-parms-partial.cfg b/tests/xlconfigdata/test-disk-positional-parms-partial.cfg
+index 09eeb94..fd16db0 100644
+--- a/tests/xlconfigdata/test-disk-positional-parms-partial.cfg
++++ b/tests/xlconfigdata/test-disk-positional-parms-partial.cfg
+@@ -12,7 +12,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ sdl = 0
+ vnc = 1
+ vncunused = 1
+diff --git a/tests/xlconfigdata/test-disk-positional-parms-partial.xml b/tests/xlconfigdata/test-disk-positional-parms-partial.xml
+index 6578e59..e86a5be 100644
+--- a/tests/xlconfigdata/test-disk-positional-parms-partial.xml
++++ b/tests/xlconfigdata/test-disk-positional-parms-partial.xml
+@@ -19,7 +19,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
+diff --git a/tests/xlconfigdata/test-fullvirt-multiusb.cfg b/tests/xlconfigdata/test-fullvirt-multiusb.cfg
+index 003eb2b..6d456de 100755
+--- a/tests/xlconfigdata/test-fullvirt-multiusb.cfg
++++ b/tests/xlconfigdata/test-fullvirt-multiusb.cfg
+@@ -12,7 +12,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ sdl = 0
+ vnc = 1
+ vncunused = 1
+diff --git a/tests/xlconfigdata/test-fullvirt-multiusb.xml b/tests/xlconfigdata/test-fullvirt-multiusb.xml
+index d7df23a..fcd14e9 100644
+--- a/tests/xlconfigdata/test-fullvirt-multiusb.xml
++++ b/tests/xlconfigdata/test-fullvirt-multiusb.xml
+@@ -19,7 +19,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
+diff --git a/tests/xlconfigdata/test-fullvirt-nohap.cfg b/tests/xlconfigdata/test-fullvirt-nohap.cfg
+index 44bfa3c..e7e933d 100644
+--- a/tests/xlconfigdata/test-fullvirt-nohap.cfg
++++ b/tests/xlconfigdata/test-fullvirt-nohap.cfg
+@@ -13,7 +13,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ sdl = 0
+ vnc = 1
+ vncunused = 1
+diff --git a/tests/xlconfigdata/test-fullvirt-nohap.xml b/tests/xlconfigdata/test-fullvirt-nohap.xml
+index 9cd7b0b..e57e28b 100644
+--- a/tests/xlconfigdata/test-fullvirt-nohap.xml
++++ b/tests/xlconfigdata/test-fullvirt-nohap.xml
+@@ -20,7 +20,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
+diff --git a/tests/xlconfigdata/test-new-disk.cfg b/tests/xlconfigdata/test-new-disk.cfg
+index b079056..4fe76b2 100644
+--- a/tests/xlconfigdata/test-new-disk.cfg
++++ b/tests/xlconfigdata/test-new-disk.cfg
+@@ -12,7 +12,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ sdl = 0
+ vnc = 1
+ vncunused = 1
+diff --git a/tests/xlconfigdata/test-new-disk.xml b/tests/xlconfigdata/test-new-disk.xml
+index 41e8804..1bc5b43 100644
+--- a/tests/xlconfigdata/test-new-disk.xml
++++ b/tests/xlconfigdata/test-new-disk.xml
+@@ -19,7 +19,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
+diff --git a/tests/xlconfigdata/test-rbd-multihost-noauth.cfg b/tests/xlconfigdata/test-rbd-multihost-noauth.cfg
+index 99f0889..01c15d5 100644
+--- a/tests/xlconfigdata/test-rbd-multihost-noauth.cfg
++++ b/tests/xlconfigdata/test-rbd-multihost-noauth.cfg
+@@ -12,7 +12,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ sdl = 0
+ vnc = 1
+ vncunused = 1
+diff --git a/tests/xlconfigdata/test-rbd-multihost-noauth.xml b/tests/xlconfigdata/test-rbd-multihost-noauth.xml
+index 728aa1e..ef9bd17 100644
+--- a/tests/xlconfigdata/test-rbd-multihost-noauth.xml
++++ b/tests/xlconfigdata/test-rbd-multihost-noauth.xml
+@@ -19,7 +19,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
+diff --git a/tests/xlconfigdata/test-spice-features.cfg b/tests/xlconfigdata/test-spice-features.cfg
+index 48dcd86..f8a25e4 100644
+--- a/tests/xlconfigdata/test-spice-features.cfg
++++ b/tests/xlconfigdata/test-spice-features.cfg
+@@ -12,7 +12,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000" ]
+ parallel = "none"
+ serial = "none"
+diff --git a/tests/xlconfigdata/test-spice-features.xml b/tests/xlconfigdata/test-spice-features.xml
+index 3820732..8175760 100644
+--- a/tests/xlconfigdata/test-spice-features.xml
++++ b/tests/xlconfigdata/test-spice-features.xml
+@@ -19,7 +19,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
+diff --git a/tests/xlconfigdata/test-spice.cfg b/tests/xlconfigdata/test-spice.cfg
+index 7ab23e1..abdf63d 100644
+--- a/tests/xlconfigdata/test-spice.cfg
++++ b/tests/xlconfigdata/test-spice.cfg
+@@ -12,7 +12,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ vif = [ "mac=00:16:3e:66:92:9c,bridge=xenbr1,script=vif-bridge,model=e1000" ]
+ parallel = "none"
+ serial = "none"
+diff --git a/tests/xlconfigdata/test-spice.xml b/tests/xlconfigdata/test-spice.xml
+index f33691f..32cad27 100644
+--- a/tests/xlconfigdata/test-spice.xml
++++ b/tests/xlconfigdata/test-spice.xml
+@@ -19,7 +19,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
+diff --git a/tests/xlconfigdata/test-vif-rate.cfg b/tests/xlconfigdata/test-vif-rate.cfg
+index db932e5..34a19a2 100644
+--- a/tests/xlconfigdata/test-vif-rate.cfg
++++ b/tests/xlconfigdata/test-vif-rate.cfg
+@@ -12,7 +12,7 @@ localtime = 0
+ on_poweroff = "destroy"
+ on_reboot = "restart"
+ on_crash = "restart"
+-device_model = "/usr/lib/xen/bin/qemu-dm"
++device_model = "/usr/lib/xen/bin/qemu-system-i386"
+ sdl = 0
+ vnc = 1
+ vncunused = 1
+diff --git a/tests/xlconfigdata/test-vif-rate.xml b/tests/xlconfigdata/test-vif-rate.xml
+index 3620e2a..3ab7488 100644
+--- a/tests/xlconfigdata/test-vif-rate.xml
++++ b/tests/xlconfigdata/test-vif-rate.xml
+@@ -19,7 +19,7 @@
+   <on_reboot>restart</on_reboot>
+   <on_crash>restart</on_crash>
+   <devices>
+-    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
++    <emulator>/usr/lib/xen/bin/qemu-system-i386</emulator>
+     <disk type='block' device='disk'>
+       <driver name='phy' type='raw'/>
+       <source dev='/dev/HostVG/XenGuest2'/>
diff --git a/0101-spec-Advertise-nvram-paths-of-official-fedora-edk2-b.patch b/0101-spec-Advertise-nvram-paths-of-official-fedora-edk2-b.patch
new file mode 100644
index 0000000..6c018e5
--- /dev/null
+++ b/0101-spec-Advertise-nvram-paths-of-official-fedora-edk2-b.patch
@@ -0,0 +1,53 @@
+From: Cole Robinson <crobinso@redhat.com>
+Date: Fri, 20 May 2016 15:50:16 -0400
+Subject: [PATCH] spec: Advertise nvram paths of official fedora edk2 builds
+
+Fedora now ships edk2 firmware in its official repos, so adapt
+the nvram path list to match. Eventually we can remove the nightly
+links as well once some integration kinks have been worked out,
+and documentation updated.
+
+Move the macro building into the %build target, which lets us
+build up a shell variable and make things a bit more readable
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1335395
+---
+ libvirt.spec.in | 18 ++++++++++++------
+ 1 file changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/libvirt.spec.in b/libvirt.spec.in
+index 935ca89..20aecf6 100644
+--- a/libvirt.spec.in
++++ b/libvirt.spec.in
+@@ -348,12 +348,6 @@
+ %endif
+ 
+ 
+-# Advertise OVMF and AAVMF from nightly firmware repo
+-%if 0%{?fedora}
+-    %define with_loader_nvram --with-loader-nvram="/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd:/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw"
+-%endif
+-
+-
+ # The RHEL-5 Xen package has some feature backports. This
+ # flag is set to enable use of those special bits on RHEL-5
+ %if 0%{?rhel} == 5
+@@ -1488,6 +1482,18 @@ rm -rf .git
+     %endif
+ %endif
+ 
++%if 0%{?fedora}
++    # Nightly firmware repo x86/OVMF
++    LOADERS="/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd:/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd"
++    # Nightly firmware repo aarch64/AAVMF
++    LOADERS="$LOADERS:/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2.git/aarch64/vars-template-pflash.raw"
++    # Fedora official x86/OVMF
++    LOADERS="$LOADERS:/usr/share/edk2/ovmf/OVMF_CODE.fd:/usr/share/edk2/ovmf/OVMF_VARS.fd"
++    # Fedora official aarch64/AAVMF
++    LOADERS="$LOADERS:/usr/share/edk2/aarch64/QEMU_EFI-pflash.raw:/usr/share/edk2/aarch64/vars-template-pflash.raw"
++    %define with_loader_nvram --with-loader-nvram="$LOADERS"
++%endif
++
+ # place macros above and build commands below this comment
+ 
+ %if 0%{?enable_autotools}
diff --git a/libvirt.spec b/libvirt.spec
index 3674343..f99e067 100644
--- a/libvirt.spec
+++ b/libvirt.spec
@@ -382,7 +382,7 @@
 Summary: Library providing a simple virtualization API
 Name: libvirt
 Version: 1.3.4
-Release: 1%{?dist}%{?extra_release}
+Release: 2%{?dist}%{?extra_release}
 License: LGPLv2+
 Group: Development/Libraries
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -393,6 +393,16 @@ URL: http://libvirt.org/
 %endif
 Source: http://libvirt.org/sources/%{?mainturl}libvirt-%{version}.tar.gz
 
+# Fix libxl video config via virt-install (bz #1334557)
+Patch0001: 0001-Move-virDomainDefPostParseInternal-after-virDomainDe.patch
+Patch0002: 0002-Call-per-device-post-parse-callback-even-on-implicit.patch
+Patch0003: 0003-Fill-out-default-vram-in-DeviceDefPostParse.patch
+Patch0004: 0004-Fix-tests-to-include-video-ram-size.patch
+Patch0005: 0005-libxl-don-t-attempt-to-probe-a-non-existent-emulator.patch
+Patch0006: 0006-xlconfigtests-use-qemu-xen-in-all-test-data-files.patch
+# Advertise fedora edk2 firmware builds to apps (bz #1335395)
+Patch0101: 0101-spec-Advertise-nvram-paths-of-official-fedora-edk2-b.patch
+
 %if %{with_libvirtd}
 Requires: libvirt-daemon = %{version}-%{release}
     %if %{with_network}
@@ -2407,6 +2417,10 @@ exit 0
 
 
 %changelog
+* Fri May 20 2016 Cole Robinson <crobinso@redhat.com> - 1.3.4-2
+- Fix libxl video config via virt-install (bz #1334557)
+- Advertise fedora edk2 firmware builds to apps (bz #1335395)
+
 * Mon May 02 2016 Cole Robinson <crobinso@redhat.com> - 1.3.4-1
 - Rebased to version 1.3.4