[libvirt] [PATCH v3 0/6] improve setting video memory

As it was pointed out that QEMU needs that the video memory size should be rounded to power of two this patch series introduces new macro to round number to power of two. There are two special cases (more description in the commit message). This patch series also fixes few issues that I've found with using vram attribute and possible some bugs (for example if you set vram for QXL to 0, we pass the 0 to QEMU which is wrong and we shouldn't pass anything). There were also wrong usage of primary 'qxl-vga' video device and secondary 'qxl' video device. We've been setting wrong primary/secondary parameters. The main propose is to start using the vram attribute for other QEMU video devices next to QXL and also introduce vgamem attribute to set the VGA framebuffer for QXL video device. v2: https://www.redhat.com/archives/libvir-list/2014-November/msg00525.html v1: https://www.redhat.com/archives/libvir-list/2014-November/msg00024.html Pavel Hrdina (6): internal: add macro to round value to the next closest power of 2 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: use vram attribute for all video devices qemu-command: introduce new vgamem attribute for QXL video device bootstrap.conf | 1 + docs/formatdomain.html.in | 68 ++++--- docs/schemas/domaincommon.rng | 5 + src/conf/domain_conf.c | 41 +++- src/conf/domain_conf.h | 4 +- src/internal.h | 7 + src/qemu/qemu_capabilities.c | 33 ++++ src/qemu/qemu_capabilities.h | 4 + src/qemu/qemu_command.c | 74 ++++++- src/qemu/qemu_domain.c | 18 ++ src/xen/xen_driver.c | 2 +- tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 206 ++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 218 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 218 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 218 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 218 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 218 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 4 + tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 218 ++++++++++++++++++++- ...qemuhotplug-console-compat-2+console-virtio.xml | 2 +- .../qemuxml2argv-console-compat-2.xml | 2 +- .../qemuxml2argv-controller-order.xml | 2 +- .../qemuxml2argv-graphics-listen-network.xml | 2 +- .../qemuxml2argv-graphics-listen-network2.xml | 2 +- .../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +- .../qemuxml2argv-graphics-spice-agentmouse.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-sasl.xml | 2 +- .../qemuxml2argv-graphics-spice-timeout.xml | 2 +- .../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 +- .../qemuxml2argv-pci-autoadd-addr.xml | 2 +- .../qemuxml2argv-pci-autoadd-idx.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 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.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 +- tests/utiltest.c | 39 ++++ tests/virt-aa-helper-test | 2 +- 83 files changed, 2129 insertions(+), 134 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

There are two special cases, if the input number is 0 or the number is larger then 2^31 (for 32bit unsigned int). For the special cases the return value is 0 because they cannot be rounded. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- bootstrap.conf | 1 + src/internal.h | 7 +++++++ tests/utiltest.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/bootstrap.conf b/bootstrap.conf index d24a714..e7ea9c9 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -35,6 +35,7 @@ clock-time close connect configmake +count-leading-zeros count-one-bits crypto/md5 crypto/sha256 diff --git a/src/internal.h b/src/internal.h index f6a88b2..765b853 100644 --- a/src/internal.h +++ b/src/internal.h @@ -62,6 +62,7 @@ # include "c-strcase.h" # include "ignore-value.h" +# include "count-leading-zeros.h" /* On architectures which lack these limits, define them (ie. Cygwin). * Note that the libvirt code should be robust enough to handle the @@ -382,6 +383,12 @@ /* round up value to the closest multiple of size */ # define VIR_ROUND_UP(value, size) (VIR_DIV_UP(value, size) * (size)) +/* Round up to the next closest power of 2. It will return rounded number or 0 + * for 0 or number more than 2^31 (for 32bit unsigned int). */ +# define VIR_ROUND_UP_POWER_OF_TWO(value) \ + ((value) > 0 && (value) <= 1U<<(sizeof(unsigned int)*8 - 1) ? \ + 1U<<(sizeof(unsigned int)*8 - count_leading_zeros((value) - 1)) : 0) + /* Specific error values for use in forwarding programs such as * virt-login-shell; these values match what GNU env does. */ diff --git a/tests/utiltest.c b/tests/utiltest.c index 8950cf2..2dbd291 100644 --- a/tests/utiltest.c +++ b/tests/utiltest.c @@ -143,6 +143,44 @@ testParseVersionString(const void *data ATTRIBUTE_UNUSED) +struct testRoundData { + unsigned int input; + unsigned int output; +}; + +static struct testRoundData roundData[] = { + { 0, 0 }, + { 1, 1 }, + { 1000, 1024 }, + { 1024, 1024 }, + { 1025, 2048 }, + { UINT_MAX, 0 }, +}; + +static int +testRoundValueToPowerOfTwo(const void *data ATTRIBUTE_UNUSED) +{ + unsigned int result; + size_t i; + + for (i = 0; i < ARRAY_CARDINALITY(roundData); i++) { + result = VIR_ROUND_UP_POWER_OF_TWO(roundData[i].input); + if (roundData[i].output != result) { + if (virTestGetDebug() > 0) { + fprintf(stderr, "\nInput number [%u]\n", roundData[i].input); + fprintf(stderr, "Expected number [%u]\n", roundData[i].output); + fprintf(stderr, "Actual number [%u]\n", result); + } + + return -1; + } + } + + return 0; +} + + + static int mymain(void) @@ -162,6 +200,7 @@ mymain(void) DO_TEST(IndexToDiskName); DO_TEST(DiskNameToIndex); DO_TEST(ParseVersionString); + DO_TEST(RoundValueToPowerOfTwo); return result == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -- 2.0.4

On 11/20/14 20:21, Pavel Hrdina wrote:
There are two special cases, if the input number is 0 or the number is larger then 2^31 (for 32bit unsigned int). For the special cases the return value is 0 because they cannot be rounded.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- bootstrap.conf | 1 + src/internal.h | 7 +++++++ tests/utiltest.c | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+)
diff --git a/bootstrap.conf b/bootstrap.conf index d24a714..e7ea9c9 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -35,6 +35,7 @@ clock-time close connect configmake +count-leading-zeros count-one-bits crypto/md5 crypto/sha256 diff --git a/src/internal.h b/src/internal.h index f6a88b2..765b853 100644 --- a/src/internal.h +++ b/src/internal.h @@ -62,6 +62,7 @@
# include "c-strcase.h" # include "ignore-value.h" +# include "count-leading-zeros.h"
/* On architectures which lack these limits, define them (ie. Cygwin). * Note that the libvirt code should be robust enough to handle the @@ -382,6 +383,12 @@ /* round up value to the closest multiple of size */ # define VIR_ROUND_UP(value, size) (VIR_DIV_UP(value, size) * (size))
+/* Round up to the next closest power of 2. It will return rounded number or 0 + * for 0 or number more than 2^31 (for 32bit unsigned int). */ +# define VIR_ROUND_UP_POWER_OF_TWO(value) \ + ((value) > 0 && (value) <= 1U<<(sizeof(unsigned int)*8 - 1) ? \ + 1U<<(sizeof(unsigned int)*8 - count_leading_zeros((value) - 1)) : 0)
You should add spaces around the multiplication and shift operators to comply with our coding style. ACK with that changed. Peter

The vram attribute was introduced to set the video memory but it is usable only for few hypervisors excluding QEMU/KVM and the old XEN driver. Only in case of QEMU the vram was used for QXL. 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 also fixes existing strange default value for VGA devices 9MB to 16MB because the video ram should be rounded to power of two. The change of default value could affect migrations but I found out that QEMU always round the video ram to power of two internally so it's safe to change the default value to the next closest power of two and also silently correct every domain XML definition. And it's also safe because we don't pass the value to QEMU. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 66 ++++++++++++++-------- src/conf/domain_conf.c | 15 +++-- src/conf/domain_conf.h | 3 +- src/qemu/qemu_command.c | 16 ++++-- src/xen/xen_driver.c | 2 +- ...qemuhotplug-console-compat-2+console-virtio.xml | 2 +- .../qemuxml2argv-console-compat-2.xml | 2 +- .../qemuxml2argv-controller-order.xml | 2 +- .../qemuxml2argv-graphics-listen-network.xml | 2 +- .../qemuxml2argv-graphics-listen-network2.xml | 2 +- .../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +- .../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +- .../qemuxml2argv-graphics-spice-compression.args | 2 +- .../qemuxml2argv-graphics-spice-compression.xml | 2 +- .../qemuxml2argv-graphics-spice-sasl.args | 2 +- .../qemuxml2argv-graphics-spice-sasl.xml | 2 +- .../qemuxml2argv-graphics-spice-timeout.xml | 2 +- .../qemuxml2argv-graphics-spice.args | 2 +- .../qemuxml2argv-graphics-spice.xml | 2 +- .../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 +- .../qemuxml2argv-pci-autoadd-addr.xml | 2 +- .../qemuxml2argv-pci-autoadd-idx.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 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.args | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../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 +- tests/virt-aa-helper-test | 2 +- 43 files changed, 103 insertions(+), 75 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 9364eb5..4e6b919 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4651,7 +4651,7 @@ qemu-kvm -net nic,model=? /dev/null ... <devices> <video> - <model type='vga' vram='8192' heads='1'> + <model type='vga' vram='16384' heads='1'> <acceleration accel3d='yes' accel2d='yes'/> </model> </video> @@ -4661,33 +4661,51 @@ 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", <code>vram</code> with value + "16384" 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", "qemu", "vbox", "vmx" and "xen". If no + value is provided the default is used. If the size is not a power of + two it will be rounded to closest one. + </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. The ram + should also be rounded to power of two as vram. + </p> </dd> <dt><code>acceleration</code></dt> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5f4b9f6..cf55b15 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3160,6 +3160,12 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, return -1; } + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + virDomainVideoDefPtr video = dev->data.video; + video->ram = VIR_ROUND_UP_POWER_OF_TWO(video->ram); + video->vram = VIR_ROUND_UP_POWER_OF_TWO(video->vram); + } + return 0; } @@ -10089,16 +10095,15 @@ 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) return 0; switch (type) { - /* Weird, QEMU defaults to 9 MB ??! */ case VIR_DOMAIN_VIDEO_TYPE_VGA: case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: case VIR_DOMAIN_VIDEO_TYPE_VMVGA: @@ -10107,7 +10112,7 @@ virDomainVideoDefaultRAM(const virDomainDef *def, else if (def->virtType == VIR_DOMAIN_VIRT_VMWARE) return 4 * 1024; else - return 9 * 1024; + return 16 * 1024; break; case VIR_DOMAIN_VIDEO_TYPE_XEN: @@ -10268,7 +10273,7 @@ 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 { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 530a3ca..b6ea6e4 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2606,7 +2606,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 8ed7934..0392f11 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5022,11 +5022,15 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, goto error; } - /* QEMU accepts bytes for ram_size. */ - virBufferAsprintf(&buf, ",ram_size=%u", video->ram * 1024); + if (video->ram) { + /* QEMU accepts bytes for ram_size. */ + virBufferAsprintf(&buf, ",ram_size=%u", video->ram * 1024); + } - /* QEMU accepts bytes for vram_size. */ - virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); + if (video->vram) { + /* QEMU accepts bytes for vram_size. */ + virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); + } } if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) @@ -9329,8 +9333,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, diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 7334142..c9f4159 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -358,7 +358,7 @@ xenDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, case VIR_DOMAIN_VIDEO_TYPE_VGA: case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: case VIR_DOMAIN_VIDEO_TYPE_VMVGA: - dev->data.video->vram = 9 * 1024; + dev->data.video->vram = 16 * 1024; break; case VIR_DOMAIN_VIDEO_TYPE_XEN: diff --git a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml index ec1c6e8..d848677 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='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..a7209b2 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='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml b/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml index 6a98eaa..07db77e 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml @@ -73,7 +73,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='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <hostdev mode='subsystem' type='usb' managed='yes'> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml index 98b7d6a..bf78ca8 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='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml index aa458d7..62353e9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml @@ -28,7 +28,7 @@ <listen type='network' network='Bobsnetwork'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='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..1bac0b5 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='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..5f94052 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='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml index 113a236..6a29f37 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml @@ -32,7 +32,7 @@ <address type='virtio-serial' controller='1' bus='0' port='3'/> </channel> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args index 59f064b..cdc916c 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.ram_size=67108864 -global qxl.vram_size=33554432 \ -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-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml index 6c913b4..5c9683f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml @@ -33,7 +33,7 @@ <streaming mode='filter'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <video> <model type='qxl' ram='65536' vram='32768' heads='1'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args index 8847bce..0c9df16 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args @@ -6,4 +6,4 @@ SASL_CONF_PATH=/root/.sasl2 QEMU_AUDIO_DRV=spice \ -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 +qxl.vram_size=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml index eb630fa..d86cd56 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml @@ -28,7 +28,7 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml index 3ed864c..bfb189c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -77,7 +77,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='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-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args index 8430d9c..704cec7 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args @@ -8,6 +8,6 @@ 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 \ +-global qxl.vram_size=33554432 \ -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.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml index 8f58149..335ce69 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml @@ -37,7 +37,7 @@ <filetransfer enable='no'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <video> <model type='qxl' ram='65536' vram='32768' heads='1'/> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml index 694343f..f78ff48 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='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..e350142 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='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..de70bc4 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='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..e350142 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='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..afa4b5a 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='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..3313469 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='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..daecc8b 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='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-autoadd-addr.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml index 92db5e6..f8b0fc7 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml @@ -34,7 +34,7 @@ </controller> <input type='mouse' bus='ps2'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='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-autoadd-idx.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.xml index f6a3ddf..db2fee9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.xml @@ -35,7 +35,7 @@ <controller type='pci' index='8' model='pci-bridge'/> <input type='mouse' bus='ps2'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='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..683c269 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='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.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args index 6855cd2..c8045a4 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.ram_size=67108864 -global qxl.vram_size=33554432 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml index ee151be..168b2701 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='32768' 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..d9ae4af 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='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 8cc5874..08bd96e 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.ram_size=67108864 -global qxl.vram_size=33554432 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml index edaf6cb..02df713 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml @@ -23,7 +23,7 @@ <controller type='pci' index='1' model='dmi-to-pci-bridge'/> <controller type='pci' index='2' model='pci-bridge'/> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args index 8c631b1..a806d63 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args @@ -9,5 +9,5 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ -device usb-tablet,id=input0 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice \ -device \ -qxl-vga,id=video0,ram_size=67107840,vram_size=67107840,bus=pci.0,addr=0x2 \ +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-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml index 36af468..905924e 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='65536' vram='65536' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml index ae40805..abee7b6 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='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..4f4f47c 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='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..b65d86f 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='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..b8658d1 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='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..752c7d5 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='32768' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test index 4b927c1..96471ff 100755 --- a/tests/virt-aa-helper-test +++ b/tests/virt-aa-helper-test @@ -95,7 +95,7 @@ cat > "$template_xml" <<EOM <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> </devices> </domain> -- 2.0.4

On 11/20/14 20:21, Pavel Hrdina wrote:
The vram attribute was introduced to set the video memory but it is usable only for few hypervisors excluding QEMU/KVM and the old XEN driver. Only in case of QEMU the vram was used for QXL.
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 also fixes existing strange default value for VGA devices 9MB to 16MB because the video ram should be rounded to power of two.
The change of default value could affect migrations but I found out that QEMU always round the video ram to power of two internally so it's safe to change the default value to the next closest power of two and also silently correct every domain XML definition. And it's also safe because we don't pass the value to QEMU.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 66 ++++++++++++++-------- src/conf/domain_conf.c | 15 +++-- src/conf/domain_conf.h | 3 +- src/qemu/qemu_command.c | 16 ++++-- src/xen/xen_driver.c | 2 +- ...qemuhotplug-console-compat-2+console-virtio.xml | 2 +- .../qemuxml2argv-console-compat-2.xml | 2 +- .../qemuxml2argv-controller-order.xml | 2 +- .../qemuxml2argv-graphics-listen-network.xml | 2 +- .../qemuxml2argv-graphics-listen-network2.xml | 2 +- .../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +- .../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +- .../qemuxml2argv-graphics-spice-compression.args | 2 +- .../qemuxml2argv-graphics-spice-compression.xml | 2 +- .../qemuxml2argv-graphics-spice-sasl.args | 2 +- .../qemuxml2argv-graphics-spice-sasl.xml | 2 +- .../qemuxml2argv-graphics-spice-timeout.xml | 2 +- .../qemuxml2argv-graphics-spice.args | 2 +- .../qemuxml2argv-graphics-spice.xml | 2 +- .../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 +- .../qemuxml2argv-pci-autoadd-addr.xml | 2 +- .../qemuxml2argv-pci-autoadd-idx.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 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.args | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../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 +- tests/virt-aa-helper-test | 2 +- 43 files changed, 103 insertions(+), 75 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 5f4b9f6..cf55b15 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3160,6 +3160,12 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, return -1; }
+ if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + virDomainVideoDefPtr video = dev->data.video; + video->ram = VIR_ROUND_UP_POWER_OF_TWO(video->ram); + video->vram = VIR_ROUND_UP_POWER_OF_TWO(video->vram); + } + return 0; }
This hunk got applied to a different place in my tree. Please repost the patch with more context. Peter

The vram attribute was introduced to set the video memory but it is usable only for few hypervisors excluding QEMU/KVM and the old XEN driver. Only in case of QEMU the vram was used for QXL. 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 also fixes existing strange default value for VGA devices 9MB to 16MB because the video ram should be rounded to power of two. The change of default value could affect migrations but I found out that QEMU always round the video ram to power of two internally so it's safe to change the default value to the next closest power of two and also silently correct every domain XML definition. And it's also safe because we don't pass the value to QEMU. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 66 ++++++++++++++-------- src/conf/domain_conf.c | 15 +++-- src/conf/domain_conf.h | 3 +- src/qemu/qemu_command.c | 16 ++++-- src/xen/xen_driver.c | 2 +- ...qemuhotplug-console-compat-2+console-virtio.xml | 2 +- .../qemuxml2argv-console-compat-2.xml | 2 +- .../qemuxml2argv-controller-order.xml | 2 +- .../qemuxml2argv-graphics-listen-network.xml | 2 +- .../qemuxml2argv-graphics-listen-network2.xml | 2 +- .../qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +- .../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +- .../qemuxml2argv-graphics-spice-compression.args | 2 +- .../qemuxml2argv-graphics-spice-compression.xml | 2 +- .../qemuxml2argv-graphics-spice-sasl.args | 2 +- .../qemuxml2argv-graphics-spice-sasl.xml | 2 +- .../qemuxml2argv-graphics-spice-timeout.xml | 2 +- .../qemuxml2argv-graphics-spice.args | 2 +- .../qemuxml2argv-graphics-spice.xml | 2 +- .../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 +- .../qemuxml2argv-pci-autoadd-addr.xml | 2 +- .../qemuxml2argv-pci-autoadd-idx.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 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.args | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../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 +- tests/virt-aa-helper-test | 2 +- 43 files changed, 103 insertions(+), 75 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 48b1a7f..1a7eeae 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4676,49 +4676,67 @@ qemu-kvm -net nic,model=? /dev/null </p> <pre> ... <devices> <video> - <model type='vga' vram='8192' heads='1'> + <model type='vga' vram='16384' heads='1'> <acceleration accel3d='yes' accel2d='yes'/> </model> </video> </devices> ...</pre> <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", <code>vram</code> with value + "16384" 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", "qemu", "vbox", "vmx" and "xen". If no + value is provided the default is used. If the size is not a power of + two it will be rounded to closest one. + </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. The ram + should also be rounded to power of two as vram. + </p> </dd> <dt><code>acceleration</code></dt> <dd> If acceleration should be enabled (if supported) using the <code>accel3d</code> and <code>accel2d</code> attributes in the diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f1c2f5f..6313d30 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -3186,12 +3186,18 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, "only with 'rbd' disks")); return -1; } } } + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { + virDomainVideoDefPtr video = dev->data.video; + video->ram = VIR_ROUND_UP_POWER_OF_TWO(video->ram); + video->vram = VIR_ROUND_UP_POWER_OF_TWO(video->vram); + } + return 0; } static int virDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, @@ -10144,31 +10150,30 @@ virSysinfoParseXML(xmlNodePtr node, error: virSysinfoDefFree(def); def = NULL; 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) return 0; switch (type) { - /* Weird, QEMU defaults to 9 MB ??! */ case VIR_DOMAIN_VIDEO_TYPE_VGA: case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: case VIR_DOMAIN_VIDEO_TYPE_VMVGA: if (def->virtType == VIR_DOMAIN_VIRT_VBOX) return 8 * 1024; else if (def->virtType == VIR_DOMAIN_VIRT_VMWARE) return 4 * 1024; else - return 9 * 1024; + return 16 * 1024; break; case VIR_DOMAIN_VIDEO_TYPE_XEN: /* Original Xen PVFB hardcoded to 4 MB */ return 4 * 1024; @@ -10323,13 +10328,13 @@ virDomainVideoDefParseXML(xmlNodePtr node, def->ram = virDomainVideoDefaultRAM(dom, def->type); } 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); } diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 2dab1a4..6c41fdb 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2619,13 +2619,14 @@ virDomainFSDefPtr virDomainGetFilesystemForTarget(virDomainDefPtr def, const char *target); int virDomainFSInsert(virDomainDefPtr def, virDomainFSDefPtr fs); 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, virDomainObjListFilter filter, virConnectPtr conn); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index cbdef9c..8c89b0c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4899,17 +4899,21 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, virReportError(VIR_ERR_OVERFLOW, _("value for 'ram' must be less than '%u'"), UINT_MAX / 1024); goto error; } - /* QEMU accepts bytes for ram_size. */ - virBufferAsprintf(&buf, ",ram_size=%u", video->ram * 1024); + if (video->ram) { + /* QEMU accepts bytes for ram_size. */ + virBufferAsprintf(&buf, ",ram_size=%u", video->ram * 1024); + } - /* QEMU accepts bytes for vram_size. */ - virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); + if (video->vram) { + /* QEMU accepts bytes for vram_size. */ + virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); + } } if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) goto error; if (virBufferCheckError(&buf) < 0) @@ -9210,14 +9214,14 @@ qemuBuildCommandLine(virConnectPtr conn, 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"); - 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, _("value for 'vram' must be less than '%u'"), UINT_MAX / 1024); goto error; diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 7334142..c9f4159 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -355,13 +355,13 @@ xenDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && dev->data.video->vram == 0) { switch (dev->data.video->type) { case VIR_DOMAIN_VIDEO_TYPE_VGA: case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: case VIR_DOMAIN_VIDEO_TYPE_VMVGA: - dev->data.video->vram = 9 * 1024; + dev->data.video->vram = 16 * 1024; break; case VIR_DOMAIN_VIDEO_TYPE_XEN: /* Original Xen PVFB hardcoded to 4 MB */ dev->data.video->vram = 4 * 1024; break; diff --git a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml index ec1c6e8..d848677 100644 --- a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml +++ b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml @@ -88,13 +88,13 @@ <listen type='address' address='0.0.0.0'/> </graphics> <sound model='ich6'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml index 4d4ac47..a7209b2 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml @@ -85,13 +85,13 @@ <listen type='address' address='0.0.0.0'/> </graphics> <sound model='ich6'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml b/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml index 6a98eaa..07db77e 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml @@ -70,13 +70,13 @@ <listen type='address' address='0.0.0.0'/> </graphics> <sound model='ich6'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <hostdev mode='subsystem' type='usb' managed='yes'> <source> <address bus='14' device='6'/> </source> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml index 98b7d6a..bf78ca8 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml @@ -25,11 +25,11 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no'> <listen type='network' network='Bobsnetwork'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml index aa458d7..62353e9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml @@ -25,11 +25,11 @@ <input type='keyboard' bus='ps2'/> <graphics type='vnc' listen='1.2.3.4' autoport='yes'> <listen type='address' address='1.2.3.4'/> <listen type='network' network='Bobsnetwork'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml index 0177654..1bac0b5 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml @@ -24,11 +24,11 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> <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='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml index 6bebd10..5f94052 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml @@ -24,11 +24,11 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> <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='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml index 113a236..6a29f37 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml @@ -29,11 +29,11 @@ </graphics> <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> <address type='virtio-serial' controller='1' bus='0' port='3'/> </channel> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args index 59f064b..cdc916c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args @@ -3,9 +3,9 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -hda \ /dev/HostVG/QEMUGuest1 -spice port=5903,tls-port=5904,addr=127.0.0.1,\ 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.ram_size=67108864 -global qxl.vram_size=33554432 \ -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-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml index 6c913b4..5c9683f 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml @@ -30,13 +30,13 @@ <jpeg compression='auto'/> <zlib compression='auto'/> <playback compression='on'/> <streaming mode='filter'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <video> <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args index 8847bce..0c9df16 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args @@ -3,7 +3,7 @@ SASL_CONF_PATH=/root/.sasl2 QEMU_AUDIO_DRV=spice \ /usr/bin/qemu -S -M pc -m 214 -smp 1 -nodefaults \ -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -hda \ /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 +qxl.vram_size=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml index eb630fa..d86cd56 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml @@ -25,11 +25,11 @@ <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1' defaultMode='secure'> <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <memballoon model='virtio'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml index 3ed864c..bfb189c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml @@ -74,13 +74,13 @@ <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> <video> - <model type='vga' vram='9216' heads='1'/> + <model type='vga' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args index 8430d9c..704cec7 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args @@ -5,9 +5,9 @@ unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -hda \ x509-dir=/etc/pki/libvirt-spice,tls-channel=default,tls-channel=main,\ 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 \ +-global qxl.vram_size=33554432 \ -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.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml index 8f58149..335ce69 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml @@ -34,13 +34,13 @@ <playback compression='on'/> <streaming mode='filter'/> <clipboard copypaste='no'/> <filetransfer enable='no'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <video> <model type='qxl' ram='65536' vram='32768' 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..f78ff48 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml @@ -26,11 +26,11 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5900' autoport='no' listen='127.0.0.1' sharePolicy='allow-exclusive'> <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml index b35c2bd..e350142 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml @@ -26,11 +26,11 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml index 44df226..de70bc4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml @@ -24,11 +24,11 @@ <controller type='ide' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' socket='/tmp/foo.socket'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml index b35c2bd..e350142 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml @@ -26,11 +26,11 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml index cfa61be..afa4b5a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml @@ -19,11 +19,11 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5900' autoport='no' websocket='5700' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml index 356ac36..3313469 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml @@ -26,11 +26,11 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5903' autoport='no' listen='2001:1:2:3:4:5:1234:1234'> <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='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml b/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml index f70e20a..daecc8b 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml @@ -63,13 +63,13 @@ <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> <video> - <model type='vga' vram='9216' heads='1'/> + <model type='vga' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml index 92db5e6..f8b0fc7 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml @@ -31,13 +31,13 @@ </controller> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <input type='mouse' bus='ps2'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x07' slot='0x06' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.xml index f6a3ddf..db2fee9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.xml @@ -32,13 +32,13 @@ <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='pci' index='8' model='pci-bridge'/> <input type='mouse' bus='ps2'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x04' slot='0x06' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml index a1cb38c..683c269 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml @@ -198,13 +198,13 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' keymap='en-us'> <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args index 6855cd2..c8045a4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args @@ -3,7 +3,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ -monitor unix:/tmp/test-monitor,server,nowait -no-acpi \ -boot c -global q35-pcihost.pci-hole64-size=1048576K \ -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -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.ram_size=67108864 -global qxl.vram_size=33554432 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml index ee151be..168b2701 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml @@ -23,11 +23,11 @@ <pcihole64 unit='KiB'>1048576</pcihole64> </controller> <controller type='pci' index='1' model='dmi-to-pci-bridge'/> <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='32768' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml index 1f896f8..d9ae4af 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml @@ -31,11 +31,11 @@ <controller type='scsi' index='0'/> <controller type='pci' index='0' model='pci-root'/> <input type='keyboard' bus='usb'/> <input type='mouse' bus='usb'/> <graphics type='sdl'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 8cc5874..08bd96e 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args @@ -2,7 +2,7 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ /usr/libexec/qemu-kvm -S -M q35 -m 2048 -smp 2 -nographic -nodefaults \ -monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c \ -device i82801b11-bridge,id=pci.1,bus=pcie.0,addr=0x1e \ -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.ram_size=67108864 -global qxl.vram_size=33554432 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml index edaf6cb..02df713 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml @@ -20,11 +20,11 @@ <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='dmi-to-pci-bridge'/> <controller type='pci' index='2' model='pci-bridge'/> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='32768' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args index 8c631b1..a806d63 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args @@ -6,8 +6,8 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ -hda /dev/HostVG/QEMUGuest1 \ -chardev spiceport,id=charserial0,name=org.qemu.console.serial.0 \ -device isa-serial,chardev=charserial0,id=serial0 \ -device usb-tablet,id=input0 \ -spice port=5903,tls-port=5904,addr=127.0.0.1,x509-dir=/etc/pki/libvirt-spice \ -device \ -qxl-vga,id=video0,ram_size=67107840,vram_size=67107840,bus=pci.0,addr=0x2 \ +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-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml index 36af468..905924e 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml @@ -34,11 +34,11 @@ <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5903' tlsPort='5904' autoport='no' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='qxl' ram='65535' vram='65535' heads='1'/> + <model type='qxl' ram='65536' vram='65536' heads='1'/> </video> <memballoon model='virtio'/> </devices> </domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml index ae40805..abee7b6 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml @@ -26,11 +26,11 @@ <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='1.2.3.4'> <listen type='address' address='1.2.3.4'/> <listen type='network' network='Bobsnetwork'/> </graphics> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> </domain> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml index 73ebcab..4f4f47c 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml @@ -77,13 +77,13 @@ <input type='keyboard' bus='ps2'/> <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/> <sound model='ac97'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </sound> <video> - <model type='vga' vram='9216' heads='1'/> + <model type='vga' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml index 13f0f5d..b65d86f 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml @@ -31,13 +31,13 @@ </controller> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <controller type='pci' index='0' model='pci-root'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x07' slot='0x06' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml index 8748437..b8658d1 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml @@ -32,13 +32,13 @@ <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <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='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x04' slot='0x06' function='0x0'/> </memballoon> </devices> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml index 96f8eaf..752c7d5 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml @@ -21,11 +21,11 @@ </disk> <controller type='pci' index='0' model='pcie-root'/> <controller type='pci' index='1' model='dmi-to-pci-bridge'/> <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='32768' heads='1'/> </video> <memballoon model='none'/> </devices> </domain> diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test index 4b927c1..96471ff 100755 --- a/tests/virt-aa-helper-test +++ b/tests/virt-aa-helper-test @@ -92,13 +92,13 @@ cat > "$template_xml" <<EOM <model type='virtio'/> </interface> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1'/> <video> - <model type='cirrus' vram='9216' heads='1'/> + <model type='cirrus' vram='16384' heads='1'/> </video> </devices> </domain> EOM touch "$disk1" "$disk2" -- 2.0.4

On 11/24/14 12:07, Pavel Hrdina wrote:
The vram attribute was introduced to set the video memory but it is usable only for few hypervisors excluding QEMU/KVM and the old XEN driver. Only in case of QEMU the vram was used for QXL.
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 also fixes existing strange default value for VGA devices 9MB to 16MB because the video ram should be rounded to power of two.
Indeed. Except for QXL we don't pass the value to qemu or others ...
The change of default value could affect migrations but I found out that QEMU always round the video ram to power of two internally so it's safe to change the default value to the next closest power of two and also silently correct every domain XML definition. And it's also safe because we don't pass the value to QEMU.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 66 ++++++++++++++-------- src/conf/domain_conf.c | 15 +++-- src/conf/domain_conf.h | 3 +- src/qemu/qemu_command.c | 16 ++++-- src/xen/xen_driver.c | 2 +-
...
tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- tests/virt-aa-helper-test | 2 +- 43 files changed, 103 insertions(+), 75 deletions(-)
ACK. Peter

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 0392f11..0c77b57 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9328,11 +9328,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 cdc916c..e08ee20 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=33554432 \ +qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \ -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 0c9df16..4f7f09b 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=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \ +-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 704cec7..97755c3 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=33554432 \ +disable-agent-file-xfer -vga qxl -global qxl-vga.ram_size=67108864 \ +-global qxl-vga.vram_size=33554432 \ -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 c8045a4..cd2ccca 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=33554432 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 08bd96e..888aa6b 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=33554432 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 -- 2.0.4

On 11/20/14 20:21, Pavel Hrdina wrote:
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 0392f11..0c77b57 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9328,11 +9328,11 @@ qemuBuildCommandLine(virConnectPtr conn,
virCommandAddArgList(cmd, "-vga", vgastr, NULL);
+ const char *dev = qemuDeviceVideoTypeToString(primaryVideoType);
Here I'd add a comment on why is the "qemuDeviceVideoType" (that is used primarily for the --device way of specifying the video device) used instead of "qemuVideoType" (used for -vga). Perhaps you could link to the relevant qemu document for this case.
+ 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;
ACK with the comment added. Peter

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> --- added the comment src/qemu/qemu_command.c | 15 +++++++++++++-- .../qemuxml2argv-graphics-spice-compression.args | 2 +- .../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, 20 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 8c89b0c..f1e6781 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -9212,11 +9212,22 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArgList(cmd, "-vga", vgastr, NULL); + /* If we cannot use --device option to specify the video device + * in QEMU we will fallback to the old --vga option. To get the + * correct device name for the --vga option the 'qemuVideo' is + * used, but to set some device attributes we need to use the + * --global option and for that we need to specify the device + * name the same as for --device option and for that we need to + * use 'qemuDeviceVideo'. + * + * See 'Graphics Devices' section in docs/qdev-device-use.txt in + * QEMU repository. + */ + 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 cdc916c..e08ee20 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=33554432 \ +qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \ -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 0c9df16..4f7f09b 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=33554432 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \ +-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 704cec7..97755c3 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=33554432 \ +disable-agent-file-xfer -vga qxl -global qxl-vga.ram_size=67108864 \ +-global qxl-vga.vram_size=33554432 \ -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 c8045a4..cd2ccca 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=33554432 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 08bd96e..888aa6b 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=33554432 +-vga qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 -- 2.0.4

On 11/24/14 15:58, Pavel Hrdina wrote:
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> ---
added the comment
src/qemu/qemu_command.c | 15 +++++++++++++-- .../qemuxml2argv-graphics-spice-compression.args | 2 +- .../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, 20 insertions(+), 9 deletions(-)
ACK, Peter

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 | 33 ++++ src/qemu/qemu_capabilities.h | 4 + tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.2.2-1.replies | 206 ++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.3.1-1.replies | 218 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.4.2-1.replies | 218 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.5.3-1.replies | 218 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.6.0-1.replies | 218 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 4 + tests/qemucapabilitiesdata/caps_1.6.50-1.replies | 218 ++++++++++++++++++++++- tests/qemucapabilitiesdata/caps_2.1.1-1.caps | 4 + tests/qemucapabilitiesdata/caps_2.1.1-1.replies | 218 ++++++++++++++++++++++- 16 files changed, 1530 insertions(+), 49 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 56bd2d5..d2c046d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -272,6 +272,11 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "migrate-rdma", "ivshmem", "drive-iotune-max", + + "VGA.vgamem_mb", /* 180 */ + "vmware-svga.vgamem_mb", + "qxl.vgamem_mb", + "qxl-vga.vgamem_mb", ); @@ -1581,6 +1586,22 @@ static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsKVMPit[] = { { "lost_tick_policy", QEMU_CAPS_KVM_PIT_TICK_POLICY }, }; +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVGA[] = { + { "vgamem_mb", QEMU_CAPS_VGA_VGAMEM }, +}; + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsVmwareSvga[] = { + { "vgamem_mb", QEMU_CAPS_VMWARE_SVGA_VGAMEM }, +}; + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxl[] = { + { "vgamem_mb", QEMU_CAPS_QXL_VGAMEM }, +}; + +static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsQxlVga[] = { + { "vgamem_mb", QEMU_CAPS_QXL_VGA_VGAMEM }, +}; + struct virQEMUCapsObjectTypeProps { const char *type; struct virQEMUCapsStringFlags *props; @@ -1626,6 +1647,14 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ARRAY_CARDINALITY(virQEMUCapsObjectPropsUSBStorage) }, { "kvm-pit", virQEMUCapsObjectPropsKVMPit, ARRAY_CARDINALITY(virQEMUCapsObjectPropsKVMPit) }, + { "VGA", virQEMUCapsObjectPropsVGA, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVGA) }, + { "vmware-svga", virQEMUCapsObjectPropsVmwareSvga, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsVmwareSvga) }, + { "qxl", virQEMUCapsObjectPropsQxl, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxl) }, + { "qxl-vga", virQEMUCapsObjectPropsQxlVga, + ARRAY_CARDINALITY(virQEMUCapsObjectPropsQxlVga) }, }; @@ -1817,6 +1846,10 @@ virQEMUCapsExtractDeviceStr(const char *qemu, "-device", "usb-host,?", "-device", "scsi-generic,?", "-device", "usb-storage,?", + "-device", "VGA,?", + "-device", "vmware-svga,?", + "-device", "qxl,?", + "-device", "qxl-vga,?", 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 ffe3494..c5542d1 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -219,6 +219,10 @@ typedef enum { QEMU_CAPS_MIGRATE_RDMA = 177, /* have rdma migration */ QEMU_CAPS_DEVICE_IVSHMEM = 178, /* -device ivshmem */ QEMU_CAPS_DRIVE_IOTUNE_MAX = 179, /* -drive bps_max= and friends */ + QEMU_CAPS_VGA_VGAMEM = 180, /* -device VGA.vgamem_mb */ + QEMU_CAPS_VMWARE_SVGA_VGAMEM = 181, /* -device vmware-svga.vgamem_mb */ + QEMU_CAPS_QXL_VGAMEM = 182, /* -device qxl.vgamem_mb */ + QEMU_CAPS_QXL_VGA_VGAMEM = 183, /* -device qxl-vga.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..30239df 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='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.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..f501218 100644 --- a/tests/qemucapabilitiesdata/caps_1.2.2-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.2.2-1.replies @@ -1408,6 +1408,198 @@ { "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": "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": "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" + }, + { + "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": "xenpv" }, { @@ -1449,7 +1641,7 @@ "name": "none" } ], - "id": "libvirt-26" + "id": "libvirt-31" } { @@ -1521,7 +1713,7 @@ "name": "Opteron_G4" } ], - "id": "libvirt-27" + "id": "libvirt-32" } { @@ -1529,11 +1721,11 @@ "enabled": false, "present": true }, - "id": "libvirt-28" + "id": "libvirt-33" } { - "id": "libvirt-29", + "id": "libvirt-34", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-models has not been found" @@ -1541,7 +1733,7 @@ } { - "id": "libvirt-30", + "id": "libvirt-35", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1549,7 +1741,7 @@ } { - "id": "libvirt-31", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1563,5 +1755,5 @@ "state": false } ], - "id": "libvirt-32" + "id": "libvirt-37" } diff --git a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps index f4f0397..68bed9f 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.caps @@ -130,4 +130,8 @@ <flag name='host-pci-multidomain'/> <flag name='usb-audio'/> <flag name='ivshmem'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.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..e1f9704 100644 --- a/tests/qemucapabilitiesdata/caps_1.3.1-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.3.1-1.replies @@ -1575,6 +1575,210 @@ { "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-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" + } + ], + "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": "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-31" +} + +{ + "return": [ + { "name": "xenpv" }, { @@ -1623,7 +1827,7 @@ "name": "none" } ], - "id": "libvirt-28" + "id": "libvirt-32" } { @@ -1701,7 +1905,7 @@ "name": "Opteron_G5" } ], - "id": "libvirt-29" + "id": "libvirt-33" } { @@ -1709,11 +1913,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 +1925,7 @@ } { - "id": "libvirt-32", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1729,7 +1933,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-37", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1743,5 +1947,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..baf2e77 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.caps @@ -131,4 +131,8 @@ <flag name='host-pci-multidomain'/> <flag name='usb-audio'/> <flag name='ivshmem'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.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..3d797b2 100644 --- a/tests/qemucapabilitiesdata/caps_1.4.2-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.4.2-1.replies @@ -1622,6 +1622,210 @@ { "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-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" + } + ], + "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": "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-31" +} + +{ + "return": [ + { "name": "xenpv" }, { @@ -1673,7 +1877,7 @@ "name": "none" } ], - "id": "libvirt-28" + "id": "libvirt-32" } { @@ -1751,7 +1955,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-33" } { @@ -1759,11 +1963,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 +1975,7 @@ } { - "id": "libvirt-32", + "id": "libvirt-36", "error": { "class": "CommandNotFound", "desc": "The command query-tpm-types has not been found" @@ -1779,7 +1983,7 @@ } { - "id": "libvirt-33", + "id": "libvirt-37", "error": { "class": "CommandNotFound", "desc": "The command query-command-line-options has not been found" @@ -1793,5 +1997,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..496f305 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.caps @@ -140,4 +140,8 @@ <flag name='usb-audio'/> <flag name='splash-timeout'/> <flag name='ivshmem'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.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..45571a3 100644 --- a/tests/qemucapabilitiesdata/caps_1.5.3-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.5.3-1.replies @@ -1696,6 +1696,210 @@ { "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-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" + } + ], + "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": "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-31" +} + +{ + "return": [ + { "name": "pc-q35-1.4", "cpu-max": 255 }, @@ -1763,7 +1967,7 @@ "cpu-max": 1 } ], - "id": "libvirt-28" + "id": "libvirt-32" } { @@ -1841,7 +2045,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-33" } { @@ -1849,19 +2053,19 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-34" } { "return": [ ], - "id": "libvirt-31" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-32" + "id": "libvirt-36" } { @@ -2537,7 +2741,7 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-37" } { @@ -2547,5 +2751,5 @@ "state": false } ], - "id": "libvirt-34" + "id": "libvirt-38" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps index a820cd4..38333a6 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.caps @@ -146,4 +146,8 @@ <flag name='usb-audio'/> <flag name='splash-timeout'/> <flag name='ivshmem'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.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..ae4b3f4 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.0-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.0-1.replies @@ -1758,6 +1758,210 @@ { "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-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" + } + ], + "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": "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-31" +} + +{ + "return": [ + { "name": "xenpv", "cpu-max": 1 }, @@ -1841,7 +2045,7 @@ "cpu-max": 1 } ], - "id": "libvirt-28" + "id": "libvirt-32" } { @@ -1919,7 +2123,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-33" } { @@ -1927,19 +2131,19 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-34" } { "return": [ ], - "id": "libvirt-31" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-32" + "id": "libvirt-36" } { @@ -2517,7 +2721,7 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-37" } { @@ -2539,5 +2743,5 @@ "state": false } ], - "id": "libvirt-34" + "id": "libvirt-38" } diff --git a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps index f65b3f4..b093e08 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.50-1.caps +++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.caps @@ -146,4 +146,8 @@ <flag name='usb-audio'/> <flag name='splash-timeout'/> <flag name='ivshmem'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.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..90d31f0 100644 --- a/tests/qemucapabilitiesdata/caps_1.6.50-1.replies +++ b/tests/qemucapabilitiesdata/caps_1.6.50-1.replies @@ -1722,6 +1722,210 @@ { "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-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" + } + ], + "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": "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-31" +} + +{ + "return": [ + { "name": "xenpv", "cpu-max": 1 }, @@ -1813,7 +2017,7 @@ "cpu-max": 1 } ], - "id": "libvirt-28" + "id": "libvirt-32" } { @@ -1891,7 +2095,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-33" } { @@ -1899,19 +2103,19 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-34" } { "return": [ ], - "id": "libvirt-31" + "id": "libvirt-35" } { "return": [ ], - "id": "libvirt-32" + "id": "libvirt-36" } { @@ -2499,7 +2703,7 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-37" } { @@ -2521,5 +2725,5 @@ "state": false } ], - "id": "libvirt-34" + "id": "libvirt-38" } diff --git a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps index 7003ad8..4e040fc 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1-1.caps +++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.caps @@ -161,4 +161,8 @@ <flag name='migrate-rdma'/> <flag name='ivshmem'/> <flag name='drive-iotune-max'/> + <flag name='VGA.vgamem_mb'/> + <flag name='vmware-svga.vgamem_mb'/> + <flag name='qxl.vgamem_mb'/> + <flag name='qxl-vga.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..511461a 100644 --- a/tests/qemucapabilitiesdata/caps_2.1.1-1.replies +++ b/tests/qemucapabilitiesdata/caps_2.1.1-1.replies @@ -2166,6 +2166,210 @@ } { + "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-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" + } + ], + "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": "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-31" +} + +{ "return": [ { "name": "pc-1.3", @@ -2275,7 +2479,7 @@ "cpu-max": 255 } ], - "id": "libvirt-28" + "id": "libvirt-32" } { @@ -2356,7 +2560,7 @@ "name": "qemu64" } ], - "id": "libvirt-29" + "id": "libvirt-33" } { @@ -2364,21 +2568,21 @@ "enabled": false, "present": true }, - "id": "libvirt-30" + "id": "libvirt-34" } { "return": [ "tpm-tis" ], - "id": "libvirt-31" + "id": "libvirt-35" } { "return": [ "passthrough" ], - "id": "libvirt-32" + "id": "libvirt-36" } { @@ -3238,7 +3442,7 @@ "option": "drive" } ], - "id": "libvirt-33" + "id": "libvirt-37" } { @@ -3260,5 +3464,5 @@ "capability": "zero-blocks" } ], - "id": "libvirt-34" + "id": "libvirt-38" } -- 2.0.4

On 11/20/14 20:21, Pavel Hrdina wrote:
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 | 33 ++++ src/qemu/qemu_capabilities.h | 4 +
...
16 files changed, 1530 insertions(+), 49 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
ACK

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. To provide this feature to users qemu has dedicated device attribute called 'vgamem_mb' to set the video memory size. We will use the 'vram' attribute also for setting video memory size for other qemu video devices. Only for cirrus device we will ignore the vram value because it has hardcoded video size in QEMU. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_command.c | 32 ++++++++++++++++++++++ .../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 | 16 +++++++++++ 19 files changed, 367 insertions(+) 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/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0c77b57..ac36567 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5031,6 +5031,19 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, /* QEMU accepts bytes for vram_size. */ virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } + } else if (video->vram && + ((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->vram % 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("value for 'vram' must be multiple of 1024")); + goto error; + } + + virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vram / 1024); } if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) @@ -9360,6 +9373,25 @@ qemuBuildCommandLine(virConnectPtr conn, dev, vram * 1024); } } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && + def->videos[0]->vram && + ((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 vram = def->videos[0]->vram; + + if (vram % 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, vram / 1024); + } } if (def->nvideos > 1) { 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..c9eb535 --- /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,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..9fc42af --- /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' 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..9fc42af --- /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' 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..9fc42af --- /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' 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..5fc41bb --- /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,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-vgamem.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.xml new file mode 100644 index 0000000..0868f39 --- /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' heads='1'/> + </video> + <video> + <model type='qxl' 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..0868f39 --- /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' heads='1'/> + </video> + <video> + <model type='qxl' 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..0868f39 --- /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' heads='1'/> + </video> + <video> + <model type='qxl' 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..9b1ddfc --- /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' vram='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..9b1ddfc --- /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' vram='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..9b1ddfc --- /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' vram='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index b2e60e8..8e7aef3 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1351,6 +1351,22 @@ 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); + 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); DO_TEST("virtio-rng-default", QEMU_CAPS_DEVICE, QEMU_CAPS_DEVICE_VIRTIO_RNG, QEMU_CAPS_OBJECT_RNG_RANDOM); -- 2.0.4

On 11/20/14 20:21, Pavel Hrdina wrote:
So far we hadn't any option to set video memory size for qemu video
hadn't had or didn't have
devices. There were only vram (ram for QXL) attribute but it was valid
There was only the
only for QXL video device.
for the
To provide this feature to users qemu has dedicated device attribute
qemu has a
called 'vgamem_mb' to set the video memory size. We will use the 'vram' attribute also for setting video memory size for other qemu video
attribute for
devices.
Only for cirrus device we will ignore the vram value because it has hardcoded video size in QEMU.
For the cirrus device
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> ---
...
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0c77b57..ac36567 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5031,6 +5031,19 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, /* QEMU accepts bytes for vram_size. */ virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } + } else if (video->vram && + ((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->vram % 1024) {
With the power of two rounding function this should effectively boil down to the following check: if (video->vram < 1024) { ... Is that intended? In that case shouldn't we change the condition and error message to make it more obvious?
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("value for 'vram' must be multiple of 1024")); + goto error; + } + + virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vram / 1024); }
if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) @@ -9360,6 +9373,25 @@ qemuBuildCommandLine(virConnectPtr conn, dev, vram * 1024); } } + + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && + def->videos[0]->vram && + ((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 vram = def->videos[0]->vram; + + if (vram % 1024) {
Same here.
+ 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, vram / 1024); + } }
if (def->nvideos > 1) {
ACK with the tweak if you agree with my analysys. Peter

Add attribute to set vgamem_mb parameter of QXL device for QEMU. This value sets the size of VGA framebuffer for QXL device. Default value in QEMU is 8MB so reuse it also in libvirt to not break things. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 4 +++- docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 26 ++++++++++++++++++++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 22 ++++++++++++++++-- src/qemu/qemu_domain.c | 18 +++++++++++++++ .../qemuxml2argv-graphics-spice-compression.xml | 4 ++-- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 ++-- .../qemuxml2argv-graphics-spice.xml | 4 ++-- .../qemuxml2argv-pcihole64-q35.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-qxl-device-vgamem.args | 4 ++-- .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 6 ++--- tests/qemuxml2argvtest.c | 6 +++-- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- 16 files changed, 92 insertions(+), 20 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 4e6b919..444e681 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4704,7 +4704,9 @@ qemu-kvm -net nic,model=? /dev/null 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. The ram - should also be rounded to power of two as vram. + should also be rounded to power of two as vram. There is also optional + attribute <code>vgamem</code> (<span class="since">since 1.2.11</span>) + to set the size of VGA framebuffer for fallback mode of QXL device. </p> </dd> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 6863ec6..569e020 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2861,6 +2861,11 @@ <ref name="unsignedInt"/> </attribute> </optional> + <optional> + <attribute name="vgamem"> + <ref name="unsignedInt"/> + </attribute> + </optional> </group> </choice> <optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index cf55b15..15fd354 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10214,6 +10214,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, char *heads = NULL; char *vram = NULL; char *ram = NULL; + char *vgamem = NULL; char *primary = NULL; if (VIR_ALLOC(def) < 0) @@ -10227,6 +10228,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) { @@ -10280,6 +10282,19 @@ virDomainVideoDefParseXML(xmlNodePtr node, def->vram = virDomainVideoDefaultRAM(dom, def->type); } + if (vgamem) { + if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vgamem attribute only supported for type of qxl")); + goto error; + } + if (virStrToLong_ui(vgamem, NULL, 10, &def->vgamem) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("cannot parse video vgamem '%s'"), vgamem); + goto error; + } + } + if (heads) { if (virStrToLong_ui(heads, NULL, 10, &def->heads) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -10296,6 +10311,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, VIR_FREE(type); VIR_FREE(ram); VIR_FREE(vram); + VIR_FREE(vgamem); VIR_FREE(heads); return def; @@ -10305,6 +10321,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, VIR_FREE(type); VIR_FREE(ram); VIR_FREE(vram); + VIR_FREE(vgamem); VIR_FREE(heads); return NULL; } @@ -14610,6 +14627,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"), @@ -17977,6 +18001,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 b6ea6e4..c89afc2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1278,6 +1278,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; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ac36567..5c0ca75 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5031,6 +5031,12 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, /* QEMU accepts bytes for vram_size. */ virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } + + if ((primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) || + (!primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM))) { + /* QEMU accepts mibibytes for vgamem_mb. */ + virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); + } } else if (video->vram && ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || @@ -9348,6 +9354,7 @@ qemuBuildCommandLine(virConnectPtr conn, virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { unsigned int ram = def->videos[0]->ram; unsigned int vram = def->videos[0]->vram; + unsigned int vgamem = def->videos[0]->vgamem; if (vram > (UINT_MAX / 1024)) { virReportError(VIR_ERR_OVERFLOW, @@ -9372,6 +9379,12 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArgFormat(cmd, "%s.vram_size=%u", dev, vram * 1024); } + if (vgamem && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vgamem / 1024); + } } if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && @@ -12387,8 +12400,13 @@ qemuParseCommandLine(virCapsPtr qemuCaps, else vid->type = video; vid->vram = virDomainVideoDefaultRAM(def, vid->type); - vid->ram = vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL ? - virDomainVideoDefaultRAM(def, vid->type) : 0; + if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + vid->ram = virDomainVideoDefaultRAM(def, vid->type); + vid->vgamem = 8 * 1024; + } else { + vid->ram = 0; + vid->vgamem = 0; + } vid->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, vid) < 0) { diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 01bf39b..0dc3ed2 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1176,6 +1176,24 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, goto cleanup; } + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (dev->data.video->vgamem) { + if (dev->data.video->vgamem % 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be multiple of 1024")); + goto cleanup; + } + if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be power of two")); + goto cleanup; + } + } else { + dev->data.video->vgamem = 8 * 1024; + } + } + ret = 0; cleanup: diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml index 5c9683f..c13327a 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='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' 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..ac705f3 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='8192' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='65536' heads='1'/> + <model type='qxl' ram='65536' vram='65536' vgamem='8192' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml index 335ce69..0c61ee5 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='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml index 168b2701..ef9cd4f 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='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml index 02df713..05967a4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml @@ -23,7 +23,7 @@ <controller type='pci' index='1' model='dmi-to-pci-bridge'/> <controller type='pci' index='2' model='pci-bridge'/> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml index 905924e..1127db1 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='65536' vram='65536' heads='1'/> + <model type='qxl' ram='65536' vram='65536' vgamem='8192' 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 index c9eb535..5398ffe 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args @@ -2,5 +2,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 -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 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\ +,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args index 5fc41bb..82aa0a9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args @@ -2,7 +2,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 qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\ +,bus=pci.0,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864\ +,vgamem_mb=8,bus=pci.0,addr=0x4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 8e7aef3..8ef0e38 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1360,13 +1360,15 @@ mymain(void) 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_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_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-q35.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml index 752c7d5..9dd4162 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='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <memballoon model='none'/> </devices> -- 2.0.4

On 11/20/14 20:21, Pavel Hrdina wrote:
Add attribute to set vgamem_mb parameter of QXL device for QEMU. This value sets the size of VGA framebuffer for QXL device. Default value in QEMU is 8MB so reuse it also in libvirt to not break things.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 4 +++- docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 26 ++++++++++++++++++++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 22 ++++++++++++++++-- src/qemu/qemu_domain.c | 18 +++++++++++++++ .../qemuxml2argv-graphics-spice-compression.xml | 4 ++-- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 ++-- .../qemuxml2argv-graphics-spice.xml | 4 ++-- .../qemuxml2argv-pcihole64-q35.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-qxl-device-vgamem.args | 4 ++-- .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 6 ++--- tests/qemuxml2argvtest.c | 6 +++-- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- 16 files changed, 92 insertions(+), 20 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 4e6b919..444e681 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4704,7 +4704,9 @@ qemu-kvm -net nic,model=? /dev/null 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. The ram - should also be rounded to power of two as vram. + should also be rounded to power of two as vram. There is also optional + attribute <code>vgamem</code> (<span class="since">since 1.2.11</span>)
qemu only
+ to set the size of VGA framebuffer for fallback mode of QXL device. </p> </dd>
...
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b6ea6e4..c89afc2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1278,6 +1278,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) */
They are now also powers of two, aren't they? also "multiples of 1024" in that case means "at least 1024". We should state that in the comment also in the previous patch that changes the meaning of the two above.
unsigned int heads; bool primary; virDomainVideoAccelDefPtr accel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ac36567..5c0ca75 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5031,6 +5031,12 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, /* QEMU accepts bytes for vram_size. */ virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } + + if ((primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) || + (!primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM))) { + /* QEMU accepts mibibytes for vgamem_mb. */
mebibytes
+ virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); + } } else if (video->vram && ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 01bf39b..0dc3ed2 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1176,6 +1176,24 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, goto cleanup; }
+ if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (dev->data.video->vgamem) { + if (dev->data.video->vgamem % 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be multiple of 1024")); + goto cleanup; + } + if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be power of two")); + goto cleanup; + }
Again, these two checks together form a condition "at least 1024 && power of two"
+ } else { + dev->data.video->vgamem = 8 * 1024; + } + } + ret = 0;
cleanup:
Peter

On 11/24/2014 03:03 PM, Peter Krempa wrote:
On 11/20/14 20:21, Pavel Hrdina wrote:
Add attribute to set vgamem_mb parameter of QXL device for QEMU. This value sets the size of VGA framebuffer for QXL device. Default value in QEMU is 8MB so reuse it also in libvirt to not break things.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 4 +++- docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 26 ++++++++++++++++++++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 22 ++++++++++++++++-- src/qemu/qemu_domain.c | 18 +++++++++++++++ .../qemuxml2argv-graphics-spice-compression.xml | 4 ++-- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 ++-- .../qemuxml2argv-graphics-spice.xml | 4 ++-- .../qemuxml2argv-pcihole64-q35.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-qxl-device-vgamem.args | 4 ++-- .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 6 ++--- tests/qemuxml2argvtest.c | 6 +++-- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- 16 files changed, 92 insertions(+), 20 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 4e6b919..444e681 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4704,7 +4704,9 @@ qemu-kvm -net nic,model=? /dev/null 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. The ram - should also be rounded to power of two as vram. + should also be rounded to power of two as vram. There is also optional + attribute <code>vgamem</code> (<span class="since">since 1.2.11</span>)
qemu only
+ to set the size of VGA framebuffer for fallback mode of QXL device. </p> </dd>
...
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index b6ea6e4..c89afc2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1278,6 +1278,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) */
They are now also powers of two, aren't they? also "multiples of 1024" in that case means "at least 1024". We should state that in the comment also in the previous patch that changes the meaning of the two above.
This has nothing in common with this patch series as the "multiples of 1024" only claims the same as kibibytes that the value is bytes multiple by 1024 and not by 1000.
unsigned int heads; bool primary; virDomainVideoAccelDefPtr accel; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index ac36567..5c0ca75 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5031,6 +5031,12 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, /* QEMU accepts bytes for vram_size. */ virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } + + if ((primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) || + (!primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM))) { + /* QEMU accepts mibibytes for vgamem_mb. */
mebibytes
+ virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); + } } else if (video->vram && ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) ||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 01bf39b..0dc3ed2 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1176,6 +1176,24 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, goto cleanup; }
+ if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (dev->data.video->vgamem) { + if (dev->data.video->vgamem % 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be multiple of 1024")); + goto cleanup; + } + if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be power of two")); + goto cleanup; + }
Again, these two checks together form a condition "at least 1024 && power of two"
+ } else { + dev->data.video->vgamem = 8 * 1024; + } + } + ret = 0;
cleanup:
Peter
For the rest I'll send v4, thanks. Pavel

Add attribute to set vgamem_mb parameter of QXL device for QEMU. This value sets the size of VGA framebuffer for QXL device. Default value in QEMU is 8MB so reuse it also in libvirt to not break things. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 5 ++++- docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 26 ++++++++++++++++++++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 22 ++++++++++++++++-- src/qemu/qemu_domain.c | 18 +++++++++++++++ .../qemuxml2argv-graphics-spice-compression.xml | 4 ++-- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 ++-- .../qemuxml2argv-graphics-spice.xml | 4 ++-- .../qemuxml2argv-pcihole64-q35.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-qxl-device-vgamem.args | 4 ++-- .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 6 ++--- tests/qemuxml2argvtest.c | 6 +++-- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- 16 files changed, 93 insertions(+), 20 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 1a7eeae..9c1d0f4 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4732,7 +4732,10 @@ qemu-kvm -net nic,model=? /dev/null 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. The ram - should also be rounded to power of two as vram. + should also be rounded to power of two as vram. There is also optional + attribute <code>vgamem</code> (<span class="since">since 1.2.11 (QEMU + only)</span>) to set the size of VGA framebuffer for fallback mode of + QXL device. </p> </dd> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index ae5c253..cd35485 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2877,6 +2877,11 @@ <ref name="unsignedInt"/> </attribute> </optional> + <optional> + <attribute name="vgamem"> + <ref name="unsignedInt"/> + </attribute> + </optional> </group> </choice> <optional> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6313d30..5c1b1de 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10272,6 +10272,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, char *heads = NULL; char *vram = NULL; char *ram = NULL; + char *vgamem = NULL; char *primary = NULL; if (VIR_ALLOC(def) < 0) @@ -10285,6 +10286,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) { @@ -10338,6 +10340,19 @@ virDomainVideoDefParseXML(xmlNodePtr node, def->vram = virDomainVideoDefaultRAM(dom, def->type); } + if (vgamem) { + if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vgamem attribute only supported for type of qxl")); + goto error; + } + if (virStrToLong_ui(vgamem, NULL, 10, &def->vgamem) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("cannot parse video vgamem '%s'"), vgamem); + goto error; + } + } + if (heads) { if (virStrToLong_ui(heads, NULL, 10, &def->heads) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -10354,6 +10369,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, VIR_FREE(type); VIR_FREE(ram); VIR_FREE(vram); + VIR_FREE(vgamem); VIR_FREE(heads); return def; @@ -10363,6 +10379,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, VIR_FREE(type); VIR_FREE(ram); VIR_FREE(vram); + VIR_FREE(vgamem); VIR_FREE(heads); return NULL; } @@ -14668,6 +14685,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"), @@ -18048,6 +18072,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 6c41fdb..c94b83e 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1293,6 +1293,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; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 6dca5a8..12500fc 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4911,6 +4911,12 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, /* QEMU accepts bytes for vram_size. */ virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } + + if ((primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) || + (!primary && virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGAMEM))) { + /* QEMU accepts mebibytes for vgamem_mb. */ + virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); + } } else if (video->vram && ((video->type == VIR_DOMAIN_VIDEO_TYPE_VGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VGA_VGAMEM)) || @@ -9243,6 +9249,7 @@ qemuBuildCommandLine(virConnectPtr conn, virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { unsigned int ram = def->videos[0]->ram; unsigned int vram = def->videos[0]->vram; + unsigned int vgamem = def->videos[0]->vgamem; if (vram > (UINT_MAX / 1024)) { virReportError(VIR_ERR_OVERFLOW, @@ -9267,6 +9274,12 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArgFormat(cmd, "%s.vram_size=%u", dev, vram * 1024); } + if (vgamem && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_QXL_VGA_VGAMEM)) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, vgamem / 1024); + } } if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE) && @@ -12283,8 +12296,13 @@ qemuParseCommandLine(virCapsPtr qemuCaps, else vid->type = video; vid->vram = virDomainVideoDefaultRAM(def, vid->type); - vid->ram = vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL ? - virDomainVideoDefaultRAM(def, vid->type) : 0; + if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + vid->ram = virDomainVideoDefaultRAM(def, vid->type); + vid->vgamem = 8 * 1024; + } else { + vid->ram = 0; + vid->vgamem = 0; + } vid->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, vid) < 0) { diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 01bf39b..49aa446 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1176,6 +1176,24 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, goto cleanup; } + if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (dev->data.video->vgamem) { + if (dev->data.video->vgamem < 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be at least 1 MiB")); + goto cleanup; + } + if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be power of two")); + goto cleanup; + } + } else { + dev->data.video->vgamem = 8 * 1024; + } + } + ret = 0; cleanup: diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml index 5c9683f..c13327a 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='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' 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..ac705f3 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='8192' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='65536' heads='1'/> + <model type='qxl' ram='65536' vram='65536' vgamem='8192' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml index 335ce69..0c61ee5 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='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml index 168b2701..ef9cd4f 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='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml index 02df713..05967a4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml @@ -23,7 +23,7 @@ <controller type='pci' index='1' model='dmi-to-pci-bridge'/> <controller type='pci' index='2' model='pci-bridge'/> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml index 905924e..1127db1 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='65536' vram='65536' heads='1'/> + <model type='qxl' ram='65536' vram='65536' vgamem='8192' 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 index c9eb535..5398ffe 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-device-vgamem.args @@ -2,5 +2,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 -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 +-device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\ +,bus=pci.0,addr=0x2 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args index 5fc41bb..82aa0a9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-qxl-sec-device-vgamem.args @@ -2,7 +2,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 qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vgamem_mb=8\ +,bus=pci.0,addr=0x2 -device qxl,id=video1,ram_size=67108864,vram_size=67108864\ +,vgamem_mb=8,bus=pci.0,addr=0x4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 315e1f4..c7b8ecf 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1362,13 +1362,15 @@ mymain(void) 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_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_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-q35.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml index 752c7d5..9dd4162 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='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='8192' heads='1'/> </video> <memballoon model='none'/> </devices> -- 2.0.4

On 11/24/14 16:04, Pavel Hrdina wrote:
Add attribute to set vgamem_mb parameter of QXL device for QEMU. This value sets the size of VGA framebuffer for QXL device. Default value in QEMU is 8MB so reuse it also in libvirt to not break things.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 5 ++++- docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 26 ++++++++++++++++++++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 22 ++++++++++++++++-- src/qemu/qemu_domain.c | 18 +++++++++++++++ .../qemuxml2argv-graphics-spice-compression.xml | 4 ++-- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 ++-- .../qemuxml2argv-graphics-spice.xml | 4 ++-- .../qemuxml2argv-pcihole64-q35.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-qxl-device-vgamem.args | 4 ++-- .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 6 ++--- tests/qemuxml2argvtest.c | 6 +++-- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- 16 files changed, 93 insertions(+), 20 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 01bf39b..49aa446 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1176,6 +1176,24 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, goto cleanup; }
+ if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (dev->data.video->vgamem) { + if (dev->data.video->vgamem < 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be at least 1 MiB"));
I'd add "(1024 KiB)".
+ goto cleanup; + } + if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be power of two")); + goto cleanup; + } + } else { + dev->data.video->vgamem = 8 * 1024; + } + } + ret = 0;
Looks good. ACK. Peter

On 11/24/2014 06:04 PM, Peter Krempa wrote:
On 11/24/14 16:04, Pavel Hrdina wrote:
Add attribute to set vgamem_mb parameter of QXL device for QEMU. This value sets the size of VGA framebuffer for QXL device. Default value in QEMU is 8MB so reuse it also in libvirt to not break things.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1076098
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- docs/formatdomain.html.in | 5 ++++- docs/schemas/domaincommon.rng | 5 +++++ src/conf/domain_conf.c | 26 ++++++++++++++++++++++ src/conf/domain_conf.h | 1 + src/qemu/qemu_command.c | 22 ++++++++++++++++-- src/qemu/qemu_domain.c | 18 +++++++++++++++ .../qemuxml2argv-graphics-spice-compression.xml | 4 ++-- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 ++-- .../qemuxml2argv-graphics-spice.xml | 4 ++-- .../qemuxml2argv-pcihole64-q35.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-qxl-device-vgamem.args | 4 ++-- .../qemuxml2argv-video-qxl-sec-device-vgamem.args | 6 ++--- tests/qemuxml2argvtest.c | 6 +++-- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- 16 files changed, 93 insertions(+), 20 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 01bf39b..49aa446 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1176,6 +1176,24 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, goto cleanup; }
+ if (dev->type == VIR_DOMAIN_DEVICE_VIDEO && + dev->data.video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (dev->data.video->vgamem) { + if (dev->data.video->vgamem < 1024) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be at least 1 MiB"));
I'd add "(1024 KiB)".
+ goto cleanup; + } + if (dev->data.video->vgamem != VIR_ROUND_UP_POWER_OF_TWO(dev->data.video->vgamem)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("value for 'vgamem' must be power of two")); + goto cleanup; + } + } else { + dev->data.video->vgamem = 8 * 1024; + } + } + ret = 0;
Looks good. ACK.
Peter
I've updated all patches according your comments and pushed it, thanks for the review. Pavel.

Pavel Hrdina <phrdina@redhat.com> writes:
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6313d30..5c1b1de 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10272,6 +10272,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, char *heads = NULL; char *vram = NULL; char *ram = NULL; + char *vgamem = NULL; char *primary = NULL;
if (VIR_ALLOC(def) < 0) @@ -10285,6 +10286,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) { @@ -10338,6 +10340,19 @@ virDomainVideoDefParseXML(xmlNodePtr node, def->vram = virDomainVideoDefaultRAM(dom, def->type); }
+ if (vgamem) { + if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vgamem attribute only supported for type of qxl")); + goto error;
Should libvirt ignore XML attributes that makes no sense for some models and keep accepting a configuration that used to work before? (I am replying to this old post, just because it caused a regression in virt-manager) Thanks, Giuseppe

On 12/01/2014 12:53 PM, Giuseppe Scrivano wrote:
Pavel Hrdina <phrdina@redhat.com> writes:
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6313d30..5c1b1de 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10272,6 +10272,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, char *heads = NULL; char *vram = NULL; char *ram = NULL; + char *vgamem = NULL; char *primary = NULL;
if (VIR_ALLOC(def) < 0) @@ -10285,6 +10286,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) { @@ -10338,6 +10340,19 @@ virDomainVideoDefParseXML(xmlNodePtr node, def->vram = virDomainVideoDefaultRAM(dom, def->type); }
+ if (vgamem) { + if (def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vgamem attribute only supported for type of qxl")); + goto error;
Should libvirt ignore XML attributes that makes no sense for some models and keep accepting a configuration that used to work before?
(I am replying to this old post, just because it caused a regression in virt-manager)
Thanks, Giuseppe
The vgamem is a new attribute for QXL. The vram stil exists and its only silently updated to proper value. The configuration with vram=9216 is wrong and should be updated in virt-manager tests. Pavel

Pavel Hrdina <phrdina@redhat.com> writes:
The vgamem is a new attribute for QXL. The vram stil exists and its only silently updated to proper value. The configuration with vram=9216 is wrong and should be updated in virt-manager tests.
the issue exists when the type of an existing QXL device is changed. virt-manager re-uses the XML configuration without modifying attributes it doesn't understand (as vgamem in this case) but changing only type='qxl' to type='$NEW_TYPE'. My doubt here is if an additional attribute should be silently ignored or users of the API should be filtering it out if type != 'qxl'. Another point is that this attribute will be added in future for some other models, then all users must be updated as well to support it, instead of having it only in libvirt. What do you think? Regards, Giuseppe

On 12/01/2014 01:50 PM, Giuseppe Scrivano wrote:
Pavel Hrdina <phrdina@redhat.com> writes:
The vgamem is a new attribute for QXL. The vram stil exists and its only silently updated to proper value. The configuration with vram=9216 is wrong and should be updated in virt-manager tests.
the issue exists when the type of an existing QXL device is changed. virt-manager re-uses the XML configuration without modifying attributes it doesn't understand (as vgamem in this case) but changing only type='qxl' to type='$NEW_TYPE'.
My doubt here is if an additional attribute should be silently ignored or users of the API should be filtering it out if type != 'qxl'. Another point is that this attribute will be added in future for some other models, then all users must be updated as well to support it, instead of having it only in libvirt.
What do you think?
Regards, Giuseppe
Well, I think that this is not correct usage of the libvirt XML. You should not just change one part of the device configuration. If user of virt-manager change the device type, you should create a new XML according to the new device type and copy all valid values and then drop the original XML configuration. I don't think that just silently remove unsupported configuration is appropriate solution. Even if we will print warning that it's not supported and it will be removed I still don't like it. It's not that the user should filter the "vgamem" out if type != 'qxl' but the user of the XML configuration should have some templates for existing devices and should use for each type different template. With this approach is ease to manage the device type change and also new features introduced by libvirt. You just modify the affected templates to support new features. Pavel

Pavel Hrdina <phrdina@redhat.com> writes:
Well, I think that this is not correct usage of the libvirt XML. You should not just change one part of the device configuration. If user of virt-manager change the device type, you should create a new XML according to the new device type and copy all valid values and then drop the original XML configuration.
I don't think that just silently remove unsupported configuration is appropriate solution. Even if we will print warning that it's not supported and it will be removed I still don't like it.
ok thanks to have confirmed it. I'll fix it in virt-manager. Regards, Giuseppe
participants (3)
-
Giuseppe Scrivano
-
Pavel Hrdina
-
Peter Krempa