[libvirt] [PATCH 0/4] [RFE] introduce new vgamem attribute for video devices

This patch series fixes few issues with vram and ram attributes for video devices and introduces new vgamem attribute to allow setting up video memory size for QEMU video devices. Pavel Hrdina (4): video: cleanup usage of vram attribute and update documentation qxl: fix setting ram and vram values for qemu qxl device caps: introduce new qemu capability for vgamem_mb device property qemu-command: introduce new vgamem attribute for video devices docs/formatdomain.html.in | 68 ++++-- docs/schemas/domaincommon.rng | 5 + src/conf/domain_conf.c | 66 +++++- src/conf/domain_conf.h | 5 +- src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 41 ++++ src/qemu/qemu_capabilities.h | 5 + src/qemu/qemu_command.c | 53 ++++- tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 232 ++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 248 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 248 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 248 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 248 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 248 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 5 + tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 248 ++++++++++++++++++++- ...qemuhotplug-console-compat-2+console-virtio.xml | 2 +- .../qemuxml2argv-console-compat-2.xml | 2 +- .../qemuxml2argv-graphics-listen-network.xml | 2 +- .../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +- .../qemuxml2argv-graphics-spice-compression.args | 2 +- .../qemuxml2argv-graphics-spice-compression.xml | 4 +- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 +- .../qemuxml2argv-graphics-spice-sasl.args | 4 +- .../qemuxml2argv-graphics-spice.args | 4 +- .../qemuxml2argv-graphics-spice.xml | 4 +- .../qemuxml2argv-graphics-vnc-policy.xml | 2 +- .../qemuxml2argv-graphics-vnc-sasl.xml | 2 +- .../qemuxml2argv-graphics-vnc-socket.xml | 2 +- .../qemuxml2argv-graphics-vnc-tls.xml | 2 +- .../qemuxml2argv-graphics-vnc-websocket.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 2 +- .../qemuxml2argv-net-bandwidth.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 2 +- .../qemuxml2argv-pcihole64-q35.args | 2 +- .../qemuxml2argv-pcihole64-q35.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-qxl-device-vgamem.args | 6 + .../qemuxml2argv-video-qxl-device-vgamem.xml | 29 +++ .../qemuxml2argv-video-qxl-device.args | 6 + .../qemuxml2argv-video-qxl-device.xml | 29 +++ .../qemuxml2argv-video-qxl-nodevice.args | 5 + .../qemuxml2argv-video-qxl-nodevice.xml | 29 +++ .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 8 + .../qemuxml2argv-video-qxl-sec-device-vgamem.xml | 32 +++ .../qemuxml2argv-video-qxl-sec-device.args | 7 + .../qemuxml2argv-video-qxl-sec-device.xml | 32 +++ .../qemuxml2argv-video-qxl-sec-nodevice.xml | 32 +++ .../qemuxml2argv-video-vga-device-vgamem.args | 6 + .../qemuxml2argv-video-vga-device-vgamem.xml | 29 +++ .../qemuxml2argv-video-vga-device.args | 6 + .../qemuxml2argv-video-vga-device.xml | 29 +++ .../qemuxml2argv-video-vga-nodevice.args | 5 + .../qemuxml2argv-video-vga-nodevice.xml | 29 +++ tests/qemuxml2argvtest.c | 18 ++ .../qemuxml2xmlout-graphics-listen-network2.xml | 2 +- .../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +- .../qemuxml2xmlout-pci-autoadd-addr.xml | 2 +- .../qemuxml2xmlout-pci-autoadd-idx.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- ...emuxml2xmlout-seclabel-dynamic-none-relabel.xml | 2 +- 70 files changed, 2288 insertions(+), 117 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml -- 2.0.4

The vram attribute was introduced to set the video memory but it is usable only for few hypervisors excluding QEMU/KVM. QEMU/KVM has different attribute for this purpose "vgamem_mb" and it will be introduced lately. The correct usage of vram is to set the video memory for other hypervisors or to set secondary bar size for QXL video device for QEMU/KVM. This patch updates the documentation to reflect current code in libvirt and also changes the cases when we will set the default vram attribute. It's pointless to set it for QEMU/KVM if you aren't using QXL as it won't be used. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 61 +++++++++++++++++++++++++++++------------------ src/conf/domain_conf.c | 19 +++++++++++---- src/conf/domain_conf.h | 3 ++- src/qemu/qemu_command.c | 4 ++-- 4 files changed, 57 insertions(+), 30 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0099ce7..24be21c 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4615,33 +4615,48 @@ qemu-kvm -net nic,model=? /dev/null <dl> <dt><code>video</code></dt> <dd> - The <code>video</code> element is the container for describing - video devices. For backwards compatibility, if no <code>video</code> - is set but there is a <code>graphics</code> in domain xml, then libvirt - will add a default <code>video</code> according to the guest type. - For a guest of type "kvm", the default <code>video</code> for it is: - <code>type</code> with value "cirrus", <code>vram</code> with value - "9216", and <code>heads</code> with value "1". By default, the first - video device in domain xml is the primary one, but the optional - attribute <code>primary</code> (<span class="since">since 1.0.2</span>) - with value 'yes' can be used to mark the primary in cases of multiple - video device. The non-primary must be type of "qxl". The optional - attribute <code>ram</code> (<span class="since">since - 1.0.2</span>) is allowed for "qxl" type only and specifies - the size of the primary bar, while <code>vram</code> specifies the - secondary bar size. If "ram" or "vram" are not supplied a default - value is used. + <p> + The <code>video</code> element is the container for describing + video devices. For backwards compatibility, if no <code>video</code> + is set but there is a <code>graphics</code> in domain xml, then + libvirt will add a default <code>video</code> according to the guest + type. + </p> + <p> + For a guest of type "kvm", the default <code>video</code> is: + <code>type</code> with value "cirrus" and <code>heads</code> with + value "1". By default, the first video device in domain xml is + the primary one, but the optional attribute <code>primary</code> + (<span class="since">since 1.0.2</span>) with value 'yes' can be used + to mark the primary in cases of multiple video device. The non-primary + must be type of "qxl". + </p> </dd> <dt><code>model</code></dt> <dd> - The <code>model</code> element has a mandatory <code>type</code> - attribute which takes the value "vga", "cirrus", "vmvga", "xen", - "vbox", or "qxl" (<span class="since">since 0.8.6</span>) - depending on the hypervisor features available. - You can also provide the amount of video memory in kibibytes - (blocks of 1024 bytes) using - <code>vram</code> and the number of screen with <code>heads</code>. + <p> + The <code>model</code> element has a mandatory <code>type</code> + attribute which takes the value "vga", "cirrus", "vmvga", "xen", + "vbox", or "qxl" (<span class="since">since 0.8.6</span>) depending + on the hypervisor features available. + </p> + <p> + You can provide the amount of video memory in kibibytes (blocks of + 1024 bytes) using <code>vram</code>. This is supported only for guest + type of "libxl", "parallels", "vbox", "vmx" and "xen". + </p> + <p> + The number of screen can be set using <code>heads</code>. This is + supported only for guests type of "parallels", "kvm", "vbox" and "vmx". + </p> + <p> + For guest type of kvm the optional attribute <code>ram</code> + (<span class="since">since 1.0.2</span>) is allowed for "qxl" type + only and specifies the size of the primary bar, while the optional + attribute <code>vram</code> specifies the secondary bar size. + If "ram" or "vram" are not supplied a default value is used. + </p> </dd> <dt><code>acceleration</code></dt> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1b8efb1..042364a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9995,9 +9995,9 @@ virSysinfoParseXML(xmlNodePtr node, goto cleanup; } -int +unsigned int virDomainVideoDefaultRAM(const virDomainDef *def, - int type) + const virDomainVideoType type) { /* Defer setting default vram to the Xen drivers */ if (def->virtType == VIR_DOMAIN_VIRT_XEN) @@ -10174,11 +10174,22 @@ virDomainVideoDefParseXML(xmlNodePtr node, if (vram) { if (virStrToLong_ui(vram, NULL, 10, &def->vram) < 0) { virReportError(VIR_ERR_XML_ERROR, - _("cannot parse video ram '%s'"), vram); + _("cannot parse video vram '%s'"), vram); goto error; } } else { - def->vram = virDomainVideoDefaultRAM(dom, def->type); + switch (dom->virtType) { + case VIR_DOMAIN_VIRT_QEMU: + case VIR_DOMAIN_VIRT_KQEMU: + case VIR_DOMAIN_VIRT_KVM: + break; + default: + def->vram = virDomainVideoDefaultRAM(dom, def->type); + break; + } + + if (def->type == VIR_DOMAIN_VIDEO_TYPE_QXL) + def->vram = virDomainVideoDefaultRAM(dom, def->type); } if (heads) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index fbb3b2f..8aa000a 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2599,7 +2599,8 @@ int virDomainFSIndexByName(virDomainDefPtr def, const char *name); virDomainFSDefPtr virDomainFSRemove(virDomainDefPtr def, size_t i); int virDomainVideoDefaultType(const virDomainDef *def); -int virDomainVideoDefaultRAM(const virDomainDef *def, int type); +unsigned int virDomainVideoDefaultRAM(const virDomainDef *def, + const virDomainVideoType type); int virDomainObjListNumOfDomains(virDomainObjListPtr doms, bool active, diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 2e5af4f..a271997 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9272,8 +9272,8 @@ qemuBuildCommandLine(virConnectPtr conn, virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { const char *dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA) ? "qxl-vga" : "qxl"); - int ram = def->videos[0]->ram; - int vram = def->videos[0]->vram; + unsigned int ram = def->videos[0]->ram; + unsigned int vram = def->videos[0]->vram; if (vram > (UINT_MAX / 1024)) { virReportError(VIR_ERR_OVERFLOW, -- 2.0.4

QEMU has two different type of QXL display device. The first "qxl-vga" is for primary video device and second "qxl" is for secondary video device. There are also two different ways how to specify those devices on qemu command line, the first one and obsolete is using "-vga" option and the current new one is using "-device" option. The "-vga" could be used only to setup primary video device, so the "-vga qxl" equal to "-device qxl-vga". Unfortunately the "-vga qxl" doesn't support setting additional parameters for the device and "-global" option must be used for this purpose. It's mandatory to use "-global qxl-vga...." to set the parameters of primary video device previously defined with "-vga qxl". Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a271997..92d6a8f 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9267,11 +9267,11 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArgList(cmd, "-vga", vgastr, NULL); + const char *dev = qemuDeviceVideoTypeToString(primaryVideoType); + if (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_QXL && (def->videos[0]->vram || def->videos[0]->ram) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { - const char *dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA) - ? "qxl-vga" : "qxl"); unsigned int ram = def->videos[0]->ram; unsigned int vram = def->videos[0]->vram; diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args index 59f064b..ac8e316 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args @@ -6,6 +6,6 @@ x509-dir=/etc/pki/libvirt-spice,\ image-compression=auto_glz,jpeg-wan-compression=auto,\ zlib-glz-wan-compression=auto,\ playback-compression=on,streaming-video=filter -vga \ -qxl -global qxl.ram_size=67108864 -global qxl.vram_size=18874368 \ +qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=18874368 \ -device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args index 8847bce..3a73588 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args @@ -5,5 +5,5 @@ SASL_CONF_PATH=/root/.sasl2 QEMU_AUDIO_DRV=spice \ /dev/HostVG/QEMUGuest1 \ -spice port=5903,tls-port=5904,sasl,addr=127.0.0.1,\ x509-dir=/etc/pki/libvirt-spice,tls-channel=default \ --vga qxl -global qxl.ram_size=67108864 -global \ -qxl.vram_size=18874368 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=18874368 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args index 8430d9c..f2c2dcc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args @@ -7,7 +7,7 @@ plaintext-channel=inputs,\ image-compression=auto_glz,jpeg-wan-compression=auto,\ zlib-glz-wan-compression=auto,\ playback-compression=on,streaming-video=filter,disable-copy-paste,\ -disable-agent-file-xfer -vga qxl -global qxl.ram_size=67108864 \ --global qxl.vram_size=18874368 \ +disable-agent-file-xfer -vga qxl -global qxl-vga.ram_size=67108864 \ +-global qxl-vga.vram_size=18874368 \ -device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args index 6855cd2..ad72d15 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args @@ -6,4 +6,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \ -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \ -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \ --vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=18874368 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=18874368 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 8cc5874..24545fd 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args @@ -5,4 +5,4 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -device pci-bridge,chassis_nr=2,id=pci.2,bus=pci.1,addr=0x1 \ -drive file=/dev/HostVG/QEMUGuest1,if=none,id=drive-sata0-0-0 \ -device ide-drive,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0 \ --vga qxl -global qxl.ram_size=67108864 -global qxl.vram_size=18874368 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=18874368 -- 2.0.4

Allow setting vgamem size for video devices. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_capabilities.c | 41 ++++ src/qemu/qemu_capabilities.h | 5 + tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 232 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 248 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 248 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 248 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 248 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 5 + tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 248 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 5 + tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 248 ++++++++++++++++++++++- 16 files changed, 1751 insertions(+), 49 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index b6c0f1b..b241ecc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -271,6 +271,12 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "iothread", "migrate-rdma", "ivshmem", + "cirrus-vga.vgamem_mb", + + "qxl.vgamem_mb", /* 180 */ + "qxl-vga.vgamem_mb", + "VGA.vgamem_mb", + "vmware-svga.vgamem_mb", ); @@ -1571,6 +1577,26 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] = { { "lost_tick_policy", QEMU_CAPS_KVM_PIT_TICK_POLICY }, }; +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsCirrusVga[] = { + { "vgamem_mb", QEMU_CAPS_CIRRUS_VGA_VGAMEM }, +}; + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { + { "vgamem_mb", QEMU_CAPS_QXL_VGAMEM }, +}; + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = { + { "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM }, +}; + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVGA[] = { + { "vgamem_mb", QEMU_CAPS_VGA_VGAMEM }, +}; + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVmwareSvga[] = { + { "vgamem_mb", QEMU_CAPS_VMWARE_SVGA_VGAMEM }, +}; + struct virQEMUCapsObjectTypeProps { const char *type; struct virQEMUCapsStringFlags *props; @@ -1616,6 +1642,16 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage) }, { "kvm-pit", virQEMUCapsObjectPropsKVMPit, ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit) }, + { "cirrus-vga", virQEMUCapsObjectPropsCirrusVga, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsCirrusVga) }, + { "qxl", virQEMUCapsObjectPropsQxl, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, + { "qxl-vga", virQEMUCapsObjectPropsQxlVga, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxlVga) }, + { "VGA", virQEMUCapsObjectPropsVGA, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVGA) }, + { "vmware-svga", virQEMUCapsObjectPropsVmwareSvga, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga) }, }; @@ -1807,6 +1843,11 @@ virQEMUCapsExtractDeviceStr(const char *qemu, "-device", "usb-host,?", "-device", "scsi-generic,?", "-device", "usb-storage,?", + "-device", "cirrus-vga,?", + "-device", "qxl,?", + "-device", "qxl-vga,?", + "-device", "VGA,?", + "-device", "vmware-svga,?", NULL); /* qemu -help goes to stdout, but qemu -device ? goes to stderr. */ virCommandSetErrorBuffer(cmd, &output); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index c0e2172..334f844 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -218,6 +218,11 @@ typedef enum { QEMU_CAPS_OBJECT_IOTHREAD = 176, /* -object iothread */ QEMU_CAPS_MIGRATE_RDMA = 177, /* have rdma migration */ QEMU_CAPS_DEVICE_IVSHMEM = 178, /* -device ivshmem */ + QEMU_CAPS_CIRRUS_VGA_VGAMEM = 179, /* -device cirrus-vga.vgamem_mb */ + QEMU_CAPS_QXL_VGAMEM = 180, /* -device qxl.vgamem_mb */ + QEMU_CAPS_QXL_VGA_VGAMEM = 181, /* -device qxl-vga.vgamem_mb */ + QEMU_CAPS_VGA_VGAMEM = 182, /* -device VGA.vgamem_mb */ + QEMU_CAPS_VMWARE_SVGA_VGAMEM = 183, /* -device vmware-svga.vgamem_mb */ QEMU_CAPS_LAST, /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps index fc8dfc1..48af9bd 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.caps @@ -116,4 +116,8 @@ <flag name='host-pci-multidomain'/> <flag name='usb-audio'/> <flag name='ivshmem'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.vgamem_mb'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies index 4fce9d7..45bf346 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies @@ -1408,6 +1408,224 @@ { "return": [ { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + } + ], + "id": "libvirt-27" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-28" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-31" +} + +{ + "return": [ + { "name": "xenpv" }, { @@ -1449,7 +1667,7 @@ "name": "none" } ], - "id": "libvirt-26" + "id": "libvirt-32" } { @@ -1521,7 +1739,7 @@ "name": "Opteron_G4" } ], - "id": "libvirt-27" + "id": "libvirt-33" } { @@ -1529,11 +1747,11 @@ "enabled": false, "present": true }, - "id": "libvirt-28" + "id": "libvirt-34" } { - "id": "libvirt-29", + "id": "libvirt-35", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1541,7 +1759,7 @@ } { - "id": "libvirt-30", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1549,7 +1767,7 @@ } { - "id": "libvirt-31", + "id": "libvirt-37", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1563,5 +1781,5 @@ "state": false } ], - "id": "libvirt-32" + "id": "libvirt-38" } diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps index f4f0397..b635225 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps @@ -130,4 +130,9 @@ <flag name='host-pci-multidomain'/> <flag name='usb-audio'/> <flag name='ivshmem'/> + <flag name='cirrus-vga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.vgamem_mb'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies index 43713b2..55c7730 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies @@ -1575,6 +1575,240 @@ { "return": [ { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-27" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-28" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "mmio", + "type": "on/off" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-31" +} + +{ + "return": [ + { "name": "xenpv" }, { @@ -1623,7 +1857,7 @@ "name": "none" } ], - "id": "libvirt-28" + "id": "libvirt-32" } { @@ -1701,7 +1935,7 @@ "name": "Opteron_G5" } ], - "id": "libvirt-29" + "id": "libvirt-33" } { @@ -1709,11 +1943,11 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-34" } { - "id": "libvirt-31", + "id": "libvirt-35", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1721,7 +1955,7 @@ } { - "id": "libvirt-32", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1729,7 +1963,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-37", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1743,5 +1977,5 @@ "state": false } ], - "id": "libvirt-34" + "id": "libvirt-38" } diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps index e6659e4..74e2a02 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps @@ -131,4 +131,9 @@ <flag name='host-pci-multidomain'/> <flag name='usb-audio'/> <flag name='ivshmem'/> + <flag name='cirrus-vga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.vgamem_mb'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies index 34384f8..c18e2a3 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies @@ -1622,6 +1622,240 @@ { "return": [ { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-27" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-28" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "mmio", + "type": "on/off" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-31" +} + +{ + "return": [ + { "name": "xenpv" }, { @@ -1673,7 +1907,7 @@ "name": "none" } ], - "id": "libvirt-28" + "id": "libvirt-32" } { @@ -1751,7 +1985,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-33" } { @@ -1759,11 +1993,11 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-34" } { - "id": "libvirt-31", + "id": "libvirt-35", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1771,7 +2005,7 @@ } { - "id": "libvirt-32", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1779,7 +2013,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-37", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1793,5 +2027,5 @@ "state": false } ], - "id": "libvirt-34" + "id": "libvirt-38" } diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps index 9716cf5..844b046 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps @@ -140,4 +140,9 @@ <flag name='usb-audio'/> <flag name='splash-timeout'/> <flag name='ivshmem'/> + <flag name='cirrus-vga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.vgamem_mb'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies index 4613472..ac742e3 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies @@ -1696,6 +1696,240 @@ { "return": [ { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-28" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "mmio", + "type": "on/off" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-31" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-32" +} + +{ + "return": [ + { "name": "pc-q35-1.4", "cpu-max": 255 }, @@ -1763,7 +1997,7 @@ "cpu-max": 1 } ], - "id": "libvirt-28" + "id": "libvirt-33" } { @@ -1841,7 +2075,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-34" } { @@ -1849,19 +2083,19 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-31" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-32" + "id": "libvirt-37" } { @@ -2537,7 +2771,7 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-38" } { @@ -2547,5 +2781,5 @@ "state": false } ], - "id": "libvirt-34" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps index a820cd4..6eeeaa9 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps @@ -146,4 +146,9 @@ <flag name='usb-audio'/> <flag name='splash-timeout'/> <flag name='ivshmem'/> + <flag name='cirrus-vga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.vgamem_mb'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies index 4205c89..359c802 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies @@ -1758,6 +1758,240 @@ { "return": [ { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-28" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "mmio", + "type": "on/off" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-31" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-32" +} + +{ + "return": [ + { "name": "xenpv", "cpu-max": 1 }, @@ -1841,7 +2075,7 @@ "cpu-max": 1 } ], - "id": "libvirt-28" + "id": "libvirt-33" } { @@ -1919,7 +2153,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-34" } { @@ -1927,19 +2161,19 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-31" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-32" + "id": "libvirt-37" } { @@ -2517,7 +2751,7 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-38" } { @@ -2539,5 +2773,5 @@ "state": false } ], - "id": "libvirt-34" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps index f65b3f4..f8e073b 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps @@ -146,4 +146,9 @@ <flag name='usb-audio'/> <flag name='splash-timeout'/> <flag name='ivshmem'/> + <flag name='cirrus-vga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.vgamem_mb'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies index 7582385..e1fb93c 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies @@ -1722,6 +1722,240 @@ { "return": [ { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-28" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "mmio", + "type": "on/off" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-31" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-32" +} + +{ + "return": [ + { "name": "xenpv", "cpu-max": 1 }, @@ -1813,7 +2047,7 @@ "cpu-max": 1 } ], - "id": "libvirt-28" + "id": "libvirt-33" } { @@ -1891,7 +2125,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-34" } { @@ -1899,19 +2133,19 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-31" + "id": "libvirt-36" } { "return": [ ], - "id": "libvirt-32" + "id": "libvirt-37" } { @@ -2499,7 +2733,7 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-38" } { @@ -2521,5 +2755,5 @@ "state": false } ], - "id": "libvirt-34" + "id": "libvirt-39" } diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps index 7fc654d..89d7072 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps +++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps @@ -160,4 +160,9 @@ <flag name='iothread'/> <flag name='migrate-rdma'/> <flag name='ivshmem'/> + <flag name='cirrus-vga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.vgamem_mb'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> </qemuCaps> diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies index 74d09dc..834db4e 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies @@ -2166,6 +2166,240 @@ } { + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-28" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-29" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "surfaces", + "type": "int32" + }, + { + "name": "vgamem_mb", + "type": "uint32" + }, + { + "name": "vram64_size_mb", + "type": "uint32" + }, + { + "name": "vram_size_mb", + "type": "uint32" + }, + { + "name": "ram_size_mb", + "type": "uint32" + }, + { + "name": "cmdlog", + "type": "uint32" + }, + { + "name": "guestdebug", + "type": "uint32" + }, + { + "name": "debug", + "type": "uint32" + }, + { + "name": "revision", + "type": "uint32" + }, + { + "name": "vram_size", + "type": "uint32" + }, + { + "name": "ram_size", + "type": "uint32" + } + ], + "id": "libvirt-30" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "mmio", + "type": "on/off" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-31" +} + +{ + "return": [ + { + "name": "command_serr_enable", + "type": "on/off" + }, + { + "name": "multifunction", + "type": "on/off" + }, + { + "name": "rombar", + "type": "uint32" + }, + { + "name": "romfile", + "type": "string" + }, + { + "name": "addr", + "type": "pci-devfn" + }, + { + "name": "vgamem_mb", + "type": "uint32" + } + ], + "id": "libvirt-32" +} + +{ "return": [ { "name": "pc-1.3", @@ -2275,7 +2509,7 @@ "cpu-max": 255 } ], - "id": "libvirt-28" + "id": "libvirt-33" } { @@ -2356,7 +2590,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-34" } { @@ -2364,21 +2598,21 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-35" } { "return": [ "tpm-tis" ], - "id": "libvirt-31" + "id": "libvirt-36" } { "return": [ "passthrough" ], - "id": "libvirt-32" + "id": "libvirt-37" } { @@ -3238,7 +3472,7 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-38" } { @@ -3260,5 +3494,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-34" + "id": "libvirt-39" } -- 2.0.4

So far we hadn't any option to set video memory size for qemu video devices. There were only vram (ram for QXL) attribute but it was valid only for QXL video device, but it didn't set video memory only pci bar memory. To provide this feature to users qemu has dedicated device attribute called 'vgamem_mb' to set the video memory size. We will export this attribute as 'vgamem' and it will be in KiB (internally converted to MiB to pass the value in correct format for QEMU). It's only supported by those video devices: cirrus, qxl, vga and vmvga. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 7 +++- docs/schemas/domaincommon.rng | 5 +++ src/conf/domain_conf.c | 47 ++++++++++++++++++++++ src/conf/domain_conf.h | 2 + src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 45 +++++++++++++++++++++ ...qemuhotplug-console-compat-2+console-virtio.xml | 2 +- .../qemuxml2argv-console-compat-2.xml | 2 +- .../qemuxml2argv-graphics-listen-network.xml | 2 +- .../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +- .../qemuxml2argv-graphics-spice-compression.xml | 4 +- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 +- .../qemuxml2argv-graphics-spice.xml | 4 +- .../qemuxml2argv-graphics-vnc-policy.xml | 2 +- .../qemuxml2argv-graphics-vnc-sasl.xml | 2 +- .../qemuxml2argv-graphics-vnc-socket.xml | 2 +- .../qemuxml2argv-graphics-vnc-tls.xml | 2 +- .../qemuxml2argv-graphics-vnc-websocket.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 2 +- .../qemuxml2argv-net-bandwidth.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 2 +- .../qemuxml2argv-pcihole64-q35.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-qxl-device-vgamem.args | 6 +++ .../qemuxml2argv-video-qxl-device-vgamem.xml | 29 +++++++++++++ .../qemuxml2argv-video-qxl-device.args | 6 +++ .../qemuxml2argv-video-qxl-device.xml | 29 +++++++++++++ .../qemuxml2argv-video-qxl-nodevice.args | 5 +++ .../qemuxml2argv-video-qxl-nodevice.xml | 29 +++++++++++++ .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 8 ++++ .../qemuxml2argv-video-qxl-sec-device-vgamem.xml | 32 +++++++++++++++ .../qemuxml2argv-video-qxl-sec-device.args | 7 ++++ .../qemuxml2argv-video-qxl-sec-device.xml | 32 +++++++++++++++ .../qemuxml2argv-video-qxl-sec-nodevice.xml | 32 +++++++++++++++ .../qemuxml2argv-video-vga-device-vgamem.args | 6 +++ .../qemuxml2argv-video-vga-device-vgamem.xml | 29 +++++++++++++ .../qemuxml2argv-video-vga-device.args | 6 +++ .../qemuxml2argv-video-vga-device.xml | 29 +++++++++++++ .../qemuxml2argv-video-vga-nodevice.args | 5 +++ .../qemuxml2argv-video-vga-nodevice.xml | 29 +++++++++++++ tests/qemuxml2argvtest.c | 18 +++++++++ .../qemuxml2xmlout-graphics-listen-network2.xml | 2 +- .../qemuxml2xmlout-graphics-spice-timeout.xml | 2 +- .../qemuxml2xmlout-pci-autoadd-addr.xml | 2 +- .../qemuxml2xmlout-pci-autoadd-idx.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- ...emuxml2xmlout-seclabel-dynamic-none-relabel.xml | 2 +- 49 files changed, 471 insertions(+), 29 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 24be21c..f8ae70b 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4605,7 +4605,7 @@ qemu-kvm -net nic,model=? /dev/null ... <devices> <video> - <model type='vga' vram='8192' heads='1'> + <model type='vga' vram='8192' vgamem='16384' heads='1'> <acceleration accel3d='yes' accel2d='yes'/> </model> </video> @@ -4647,6 +4647,11 @@ qemu-kvm -net nic,model=? /dev/null type of "libxl", "parallels", "vbox", "vmx" and "xen". </p> <p> + To set video memory for QEMU/KVM video devices you can use + <code>vgamem</code> attribute. If you don't provide any value the + default "16MiB" will be used. (<span class="since">since 1.2.11</span>) + </p> + <p> The number of screen can be set using <code>heads</code>. This is supported only for guests type of "parallels", "kvm", "vbox" and "vmx". </p> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 20d81ae..db31d22 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2864,6 +2864,11 @@ </attribute> </optional> <optional> + <attribute name="vgamem"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> <attribute name="heads"> <ref name="unsignedInt"/> </attribute> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 042364a..48656cb 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10029,6 +10029,20 @@ virDomainVideoDefaultRAM(const virDomainDef *def, } } +unsigned int +virDomainVideoDefaultVgamem(const virDomainVideoType type) +{ + switch (type) { + case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: + case VIR_DOMAIN_VIDEO_TYPE_QXL: + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + return 16 * 1024; + + default: + return 0; + } +} int virDomainVideoDefaultType(const virDomainDef *def) @@ -10116,6 +10130,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, char *vram = NULL; char *ram = NULL; char *primary = NULL; + char *vgamem = NULL; if (VIR_ALLOC(def) < 0) return NULL; @@ -10128,6 +10143,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, type = virXMLPropString(cur, "type"); ram = virXMLPropString(cur, "ram"); vram = virXMLPropString(cur, "vram"); + vgamem = virXMLPropString(cur, "vgamem"); heads = virXMLPropString(cur, "heads"); if ((primary = virXMLPropString(cur, "primary")) != NULL) { @@ -10192,6 +10208,25 @@ virDomainVideoDefParseXML(xmlNodePtr node, def->vram = virDomainVideoDefaultRAM(dom, def->type); } + if (vgamem) { + if (def->type != VIR_DOMAIN_VIDEO_TYPE_CIRRUS && + def->type != VIR_DOMAIN_VIDEO_TYPE_QXL && + def->type != VIR_DOMAIN_VIDEO_TYPE_VGA && + def->type != VIR_DOMAIN_VIDEO_TYPE_VMVGA) { + virReportError(VIR_ERR_XML_ERROR, + _("vgamem attribute is not supported by '%s' video device"), + virDomainVideoTypeToString(def->type)); + goto error; + } + if (virStrToLong_ui(vgamem, NULL, 10, &def->vgamem) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("cannot parse video vgamem '%s'"), vgamem); + goto error; + } + } else { + def->vgamem = virDomainVideoDefaultVgamem(def->type); + } + if (heads) { if (virStrToLong_ui(heads, NULL, 10, &def->heads) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -10208,6 +10243,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, VIR_FREE(type); VIR_FREE(ram); VIR_FREE(vram); + VIR_FREE(vgamem); VIR_FREE(heads); return def; @@ -10217,6 +10253,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, VIR_FREE(type); VIR_FREE(ram); VIR_FREE(vram); + VIR_FREE(vgamem); VIR_FREE(heads); return NULL; } @@ -13636,6 +13673,7 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } video->vram = virDomainVideoDefaultRAM(def, video->type); + video->vgamem = virDomainVideoDefaultVgamem(video->type); video->heads = 1; if (VIR_ALLOC_N(def->videos, 1) < 0) { virDomainVideoDefFree(video); @@ -14560,6 +14598,13 @@ virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src, return false; } + if (src->vgamem != dst->vgamem) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Target video card vgamem %u does not match source %u"), + dst->vgamem, src->vgamem); + return false; + } + if (src->heads != dst->heads) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("Target video card heads %u does not match source %u"), @@ -17887,6 +17932,8 @@ virDomainVideoDefFormat(virBufferPtr buf, virBufferAsprintf(buf, " ram='%u'", def->ram); if (def->vram) virBufferAsprintf(buf, " vram='%u'", def->vram); + if (def->vgamem) + virBufferAsprintf(buf, " vgamem='%u'", def->vgamem); if (def->heads) virBufferAsprintf(buf, " heads='%u'", def->heads); if (def->primary) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8aa000a..ee36f49 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1271,6 +1271,7 @@ struct _virDomainVideoDef { int type; unsigned int ram; /* kibibytes (multiples of 1024) */ unsigned int vram; /* kibibytes (multiples of 1024) */ + unsigned int vgamem; /* kibibytes (multiples of 1024) */ unsigned int heads; bool primary; virDomainVideoAccelDefPtr accel; @@ -2601,6 +2602,7 @@ virDomainFSDefPtr virDomainFSRemove(virDomainDefPtr def, size_t i); int virDomainVideoDefaultType(const virDomainDef *def); unsigned int virDomainVideoDefaultRAM(const virDomainDef *def, const virDomainVideoType type); +unsigned int virDomainVideoDefaultVgamem(const virDomainVideoType type); int virDomainObjListNumOfDomains(virDomainObjListPtr doms, bool active, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 9d5c814..137ab0a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -422,6 +422,7 @@ virDomainVcpuPinFindByVcpu; virDomainVcpuPinIsDuplicate; virDomainVideoDefaultRAM; virDomainVideoDefaultType; +virDomainVideoDefaultVgamem; virDomainVideoDefFree; virDomainVideoTypeFromString; virDomainVideoTypeToString; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 92d6a8f..2da0d58 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4972,6 +4972,27 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && + video->vgamem && + ((video->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_CIRRUS_VGA_VGAMEM)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_QXL && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || + (video->type == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { + + if (video->vgamem % 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("value for 'vgamem' must be multiple of 1024")); + goto error; + } + + virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); + } + if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) goto error; @@ -9299,6 +9320,29 @@ qemuBuildCommandLine(virConnectPtr conn, dev, vram * 1024); } } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && + def->videos[0]->vgamem && + ((primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_CIRRUS && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_CIRRUS_VGA_VGAMEM)) || + (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) || + (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || + (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_VMWARE_SVGA_VGAMEM)))) { + unsigned int vgamem = def->videos[0]->vgamem; + + if (vgamem % 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("value for 'vgamem' must be multiple of 1024")); + goto error; + } + + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vgamem / 1024); + } } if (def->nvideos > 1) { @@ -12297,6 +12341,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps, vid->vram = virDomainVideoDefaultRAM(def, vid->type); vid->ram = vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL ? virDomainVideoDefaultRAM(def, vid->type) : 0; + vid->vgamem = virDomainVideoDefaultVgamem(vid->type); vid->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, vid) < 0) { diff --git a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml index ec1c6e8..980c589 100644 --- a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml +++ b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml @@ -91,7 +91,7 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml index 4d4ac47..2c425bc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml @@ -88,7 +88,7 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml index 98b7d6a..3ab386e 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml @@ -28,7 +28,7 @@ <listen type='network' network='Bobsnetwork'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml index 0177654..cd2a09c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml @@ -27,7 +27,7 @@ <input type='keyboard' bus='ps2'/> <graphics type='sdl' display=':0.1' xauth='/root/.Xauthority' fullscreen='yes'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml index 6bebd10..5914043 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml @@ -27,7 +27,7 @@ <input type='keyboard' bus='ps2'/> <graphics type='sdl' display=':0.1' xauth='/root/.Xauthority'/> <video> - <model type='vga' vram='9216' heads='1'/> + <model type='vga' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml index 6c913b4..8163020 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml @@ -33,10 +33,10 @@ <streaming mode='filter'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml index acf3019..a12206b 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml @@ -30,10 +30,10 @@ <channel name='inputs' mode='insecure'/> </graphics> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='65536' heads='1'/> + <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml index 8f58149..9396056 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml @@ -37,10 +37,10 @@ <filetransfer enable='no'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml index 694343f..df51e94 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml @@ -29,7 +29,7 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml index b35c2bd..f8fd723 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml @@ -29,7 +29,7 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml index 44df226..322ccdd 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml @@ -27,7 +27,7 @@ <input type='keyboard' bus='ps2'/> <graphics type='vnc' socket='/tmp/foo.socket'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml index b35c2bd..f8fd723 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml @@ -29,7 +29,7 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml index cfa61be..982ddcd 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml @@ -22,7 +22,7 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml index 356ac36..3b2f76b 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml @@ -29,7 +29,7 @@ <listen type='address' address='2001:1:2:3:4:5:1234:1234'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml index f70e20a..7a4d8b4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml @@ -66,7 +66,7 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> <video> - <model type='vga' vram='9216' heads='1'/> + <model type='vga' vram='9216' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml index a1cb38c..7782a43 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml @@ -201,7 +201,7 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml index ee151be..68f78a4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml @@ -26,7 +26,7 @@ <controller type='pci' index='2' model='pci-bridge'/> <controller type='sata' index='0'/> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml index 1f896f8..3df6cc6 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml @@ -34,7 +34,7 @@ <input type='mouse' bus='usb'/> <graphics type='sdl'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml index 36af468..47fabe9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml @@ -37,7 +37,7 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='qxl' ram='65535' vram='65535' heads='1'/> + <model type='qxl' ram='65535' vram='65535' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args new file mode 100644 index 0000000..92e343f --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args @@ -0,0 +1,6 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 \ +-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\ +,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml new file mode 100644 index 0000000..d2b6978 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args new file mode 100644 index 0000000..c9eb535 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.args @@ -0,0 +1,6 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 \ +-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\ +,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml new file mode 100644 index 0000000..d2b6978 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args new file mode 100644 index 0000000..a6ac6d8 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.args @@ -0,0 +1,5 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 -net none -serial none -parallel none \ +-vga qxl diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml new file mode 100644 index 0000000..d2b6978 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-nodevice.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args new file mode 100644 index 0000000..51fc524 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args @@ -0,0 +1,8 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 \ +-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=16\ +,bus=pci.0,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864\ +,vgamem_mb=16,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml new file mode 100644 index 0000000..2b66781 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml @@ -0,0 +1,32 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args new file mode 100644 index 0000000..208408e --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.args @@ -0,0 +1,7 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 \ +-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0\ +,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0\ +,addr=0x4 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml new file mode 100644 index 0000000..2b66781 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device.xml @@ -0,0 +1,32 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml new file mode 100644 index 0000000..2b66781 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-nodevice.xml @@ -0,0 +1,32 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <video> + <model type='qxl' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args new file mode 100644 index 0000000..81e4aec --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.args @@ -0,0 +1,6 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 \ +-device VGA,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml new file mode 100644 index 0000000..14a1044 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device-vgamem.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='vga' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args new file mode 100644 index 0000000..f822280 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.args @@ -0,0 +1,6 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic -nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 \ +-device VGA,id=video0,bus=pci.0,addr=0x2 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml new file mode 100644 index 0000000..14a1044 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-device.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='vga' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args new file mode 100644 index 0000000..7b5f151 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.args @@ -0,0 +1,5 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu -S -M pc -m 1024 -smp 1 -nographic \ +-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb \ +-hda /var/lib/libvirt/images/QEMUGuest1 -net none -serial none -parallel none \ +-vga std diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml new file mode 100644 index 0000000..14a1044 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-vga-nodevice.xml @@ -0,0 +1,29 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>1048576</memory> + <currentMemory unit='KiB'>1048576</currentMemory> + <vcpu>1</vcpu> + <os> + <type arch='i686' machine='pc'>hvm</type> + <boot dev='hd'/> + </os> + <clock offset='utc'/> + <on_poweroff>destroy</on_poweroff> + <on_reboot>restart</on_reboot> + <on_crash>destroy</on_crash> + <devices> + <emulator>/usr/bin/qemu</emulator> + <disk type='file' device='disk'> + <driver name='qemu' type='qcow2' cache='none'/> + <source file='/var/lib/libvirt/images/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='ide' index='0'/> + <video> + <model type='vga' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0e9fab9..47d6c95 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1322,6 +1322,24 @@ mymain(void) QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_PCI_BRIDGE); + DO_TEST("video-vga-nodevice", QEMU_CAPS_VGA); + DO_TEST("video-vga-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VGA, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-vga-device-vgamem", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VGA, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_VGA_VGAMEM); + DO_TEST("video-qxl-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL); + DO_TEST("video-qxl-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-qxl-device-vgamem", QEMU_CAPS_DEVICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_VIDEO_PRIMARY, + QEMU_CAPS_QXL_VGA_VGAMEM); + DO_TEST_FAILURE("video-qxl-sec-nodevice", QEMU_CAPS_VGA, QEMU_CAPS_VGA_QXL); + DO_TEST("video-qxl-sec-device", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_QXL_VGA, + QEMU_CAPS_DEVICE_QXL, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); + DO_TEST("video-qxl-sec-device-vgamem", QEMU_CAPS_DEVICE, + QEMU_CAPS_DEVICE_QXL_VGA, QEMU_CAPS_DEVICE_QXL, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_QXL_VGA_VGAMEM, + QEMU_CAPS_QXL_VGAMEM); DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml index ae40805..7dfa319 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml @@ -29,7 +29,7 @@ <listen type='network' network='Bobsnetwork'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml index 73ebcab..a0b0b46 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml @@ -80,7 +80,7 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> <video> - <model type='vga' vram='9216' heads='1'/> + <model type='vga' vram='9216' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml index 13f0f5d..b47e1ca 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml @@ -34,7 +34,7 @@ </controller> <controller type='pci' index='0' model='pci-root'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml index 8748437..8f83624 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml @@ -35,7 +35,7 @@ <controller type='pci' index='8' model='pci-bridge'/> <controller type='pci' index='0' model='pci-root'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='9216' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml index 96f8eaf..aa24cc8 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml @@ -24,7 +24,7 @@ <controller type='pci' index='2' model='pci-bridge'/> <controller type='sata' index='0'/> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-none-relabel.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-none-relabel.xml index 1b36533..ffcb63f 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-none-relabel.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-seclabel-dynamic-none-relabel.xml @@ -42,7 +42,7 @@ <listen type='address' address='0.0.0.0'/> </graphics> <video> - <model type='cirrus' vram='8192' heads='1'/> + <model type='cirrus' vram='8192' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> -- 2.0.4

On Mon, Nov 03, 2014 at 02:01:46PM +0100, Pavel Hrdina wrote:
This patch series fixes few issues with vram and ram attributes for video devices and introduces new vgamem attribute to allow setting up video memory size for QEMU video devices.
Well, we have 'vram' (old, always meant the size of the VGA memory), then 'ram', that can be used only for 'qxl' (I don't quite understand why we didn't just use the same value as 'vram', I doubt anyone is using the parameter for what it was designed (secondary PCI BAR size, was it?). Adding yet another attribute that tries to control the same parameter seems cumbersome. Going over the documentation and patches, this does not really cope with what libvirt tries to do. Using different attribute names depending on video model, and even hypervisor, does remove the abstraction we're trying to preserve in libvirt. Does "ram" attribute do anything for qxl device? Can't we just use the attributes we have in XML and apply them properly to the devices whilst preserving the abstraction? Martin

On 11/10/2014 08:44 AM, Martin Kletzander wrote:
On Mon, Nov 03, 2014 at 02:01:46PM +0100, Pavel Hrdina wrote:
This patch series fixes few issues with vram and ram attributes for video devices and introduces new vgamem attribute to allow setting up video memory size for QEMU video devices.
Well, we have 'vram' (old, always meant the size of the VGA memory), then 'ram', that can be used only for 'qxl' (I don't quite understand why we didn't just use the same value as 'vram', I doubt anyone is using the parameter for what it was designed (secondary PCI BAR size, was it?). Adding yet another attribute that tries to control the same parameter seems cumbersome. Going over the documentation and patches, this does not really cope with what libvirt tries to do. Using different attribute names depending on video model, and even hypervisor, does remove the abstraction we're trying to preserve in libvirt.
Does "ram" attribute do anything for qxl device? Can't we just use the attributes we have in XML and apply them properly to the devices whilst preserving the abstraction?
Martin
I've finally found some information how the ram_size_mb, vram_size_mb and vgamem_mb works together. The ram_size_mb depends on vgamem_mb because it has to be at leas twice more than vgamem_mb and the vgamem_mb sets the VGA framebuffer size. The ram_size_mb sets the size of vga ram memory. The vram_size_mb sets the memory size to be used for an offscreen surfaces. This means that only for QXL we've been able to set the video memory size properly. The vram attribute in our XML is correctly used to set the vram_size parameter and this sets secondary RAM size which is used for non-VGA mode if the guest has correct drivers. The VGA part of QXL is only as fallback before the guest loads the QXL video drivers or if the guest doesn't have one. I'll send v2. Pavel
participants (2)
-
Martin Kletzander
-
Pavel Hrdina