[libvirt] [PATCH V2 0/6] Some improvements for video model.

From: Zeng Junliang <zengjunliang@huawei.com> https://www.redhat.com/archives/libvir-list/2014-June/msg00569.html diff to v1: - Rmoving the confusing vram attribute for cirrus and stdvga. - leave out cirrus for the new vgamem attribute. - add secondary-vga supports and some other docs and tests. Zeng Junliang (6): qemu: Remove vram attribute in some cases qemu: Introduce vgamem attribute for video model qemu: Add support for secondary-vga tests: modify test case related to vgamem attribute tests: Add test cases for secondary-vga docs: add description for vgamem attribute and secondary-vga docs/formatdomain.html.in | 39 ++++--- docs/schemas/domaincommon.rng | 5 + qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 +++++++ src/conf/domain_conf.c | 71 ++++++++++-- src/conf/domain_conf.h | 4 +- src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 2 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 125 ++++++++++++++------- ...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 +- ...emuxml2argv-graphics-spice-agent-file-xfer.args | 5 +- ...qemuxml2argv-graphics-spice-agent-file-xfer.xml | 4 +- .../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +- .../qemuxml2argv-graphics-spice-compression.args | 4 +- .../qemuxml2argv-graphics-spice-compression.xml | 4 +- .../qemuxml2argv-graphics-spice-listen-network.xml | 4 +- .../qemuxml2argv-graphics-spice-qxl-vga.args | 4 +- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 +- .../qemuxml2argv-graphics-spice-sasl.args | 3 +- .../qemuxml2argv-graphics-spice-sasl.xml | 2 +- .../qemuxml2argv-graphics-spice-timeout.xml | 2 +- .../qemuxml2argv-graphics-spice.args | 5 +- .../qemuxml2argv-graphics-spice.xml | 4 +- .../qemuxml2argv-graphics-vnc-policy.xml | 2 +- .../qemuxml2argv-graphics-vnc-sasl.xml | 2 +- .../qemuxml2argv-graphics-vnc-secondary-vga.args | 7 ++ .../qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 +++++++ .../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 | 3 +- .../qemuxml2argv-pcihole64-q35.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 3 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.args | 4 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-device-pciaddr-default.args | 9 +- .../qemuxml2argv-video-device-pciaddr-default.xml | 6 +- tests/qemuxml2argvtest.c | 10 +- .../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/qemuxml2xmltest.c | 1 + 57 files changed, 345 insertions(+), 123 deletions(-) create mode 100644 qemuxml2argv-graphics-vnc-secondary-vga.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.xml -- 1.7.12.4

From: Zeng Junliang <zengjunliang@huawei.com> The vram attribute is invalid for cirrus and stdvga device, and default vram value would make us confused. It would be better to remove it. Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- src/conf/domain_conf.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b91ccf7..63d97ec 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9306,16 +9306,13 @@ virDomainVideoDefaultRAM(const virDomainDef *def, int type) { 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 0; break; case VIR_DOMAIN_VIDEO_TYPE_XEN: @@ -9474,9 +9471,19 @@ virDomainVideoDefParseXML(xmlNodePtr node, } if (vram) { + /* For type of kvm, vram attribute seems to be invalid + * for VIR_DOMAIN_VIDEO_TYPE_VMVGA. Shall we also need + * to add judge here? Will it affect other drivers? */ + if (def->type == VIR_DOMAIN_VIDEO_TYPE_VGA || + def->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vram attribute is not supported " + "for type of vga and cirrus")); + goto error; + } 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 { -- 1.7.12.4

On 14.7.2014 13:20, Wang Rui wrote:
From: Zeng Junliang <zengjunliang@huawei.com>
The vram attribute is invalid for cirrus and stdvga device, and default vram value would make us confused. It would be better to remove it.
Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- src/conf/domain_conf.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b91ccf7..63d97ec 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9306,16 +9306,13 @@ virDomainVideoDefaultRAM(const virDomainDef *def, int type) { 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 0; break;
case VIR_DOMAIN_VIDEO_TYPE_XEN: @@ -9474,9 +9471,19 @@ virDomainVideoDefParseXML(xmlNodePtr node, }
if (vram) { + /* For type of kvm, vram attribute seems to be invalid + * for VIR_DOMAIN_VIDEO_TYPE_VMVGA. Shall we also need + * to add judge here? Will it affect other drivers? */ + if (def->type == VIR_DOMAIN_VIDEO_TYPE_VGA || + def->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vram attribute is not supported " + "for type of vga and cirrus")); + goto error; + } 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 {
We cannot disable use of vram for VGA and CIRRUS because it would be a regression and all existing domains having this attribute in xml would not be loaded on libvirtd start. We have to accept the fact that the vram attribute could be defined for all current video types and for some of them it will be just ignored. So don't return error if the vram is set for VGA and CIRRUS. The only possibility is to silently remove it for qemu in qemuDomainDevicePostParse function, but that will also requires updating all qemuxml2argv and qemuxml2xml tests. Pavel

On 2014/7/24 17:37, Pavel Hrdina wrote:
--- src/conf/domain_conf.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
[...]
@@ -9474,9 +9471,19 @@ virDomainVideoDefParseXML(xmlNodePtr node, }
if (vram) { + /* For type of kvm, vram attribute seems to be invalid + * for VIR_DOMAIN_VIDEO_TYPE_VMVGA. Shall we also need + * to add judge here? Will it affect other drivers? */ + if (def->type == VIR_DOMAIN_VIDEO_TYPE_VGA || + def->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vram attribute is not supported " + "for type of vga and cirrus")); + goto error; + } 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 {
We cannot disable use of vram for VGA and CIRRUS because it would be a regression and all existing domains having this attribute in xml would not be loaded on libvirtd start. We have to accept the fact that the vram attribute could be defined for all current video types and for some of them it will be just ignored.
So don't return error if the vram is set for VGA and CIRRUS. The only possibility is to silently remove it for qemu in qemuDomainDevicePostParse function, but that will also requires updating all qemuxml2argv and qemuxml2xml tests.
Thanks for your review. You are right. In libvirt upgrade scenario, this patch will make a regression. In this case , VM should be started successfully without vram in qemu command line.
Pavel
.

From: Zeng Junliang <zengjunliang@huawei.com> This patch introduces vgamem attribute for video model, and sets its default value as qemu used. Parse it in two ways accroding to qemu startup parameters supported: -device or -vga. Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- src/conf/domain_conf.c | 48 ++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 3 +- src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 75 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 101 insertions(+), 26 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 63d97ec..d5a65c3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9328,6 +9328,20 @@ virDomainVideoDefaultRAM(const virDomainDef *def, } } +int +virDomainVideoDefaultVgamem(int type) +{ + switch (type) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + case VIR_DOMAIN_VIDEO_TYPE_QXL: + /* QEMU use 16M as default value for vga/vmvga/qxl device*/ + return 16 * 1024; + + default: + return 0; + } +} int virDomainVideoDefaultType(const virDomainDef *def) @@ -9413,6 +9427,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, char *type = NULL; char *heads = NULL; char *vram = NULL; + char *vgamem = NULL; char *ram = NULL; char *primary = NULL; @@ -9422,11 +9437,12 @@ virDomainVideoDefParseXML(xmlNodePtr node, cur = node->children; while (cur != NULL) { if (cur->type == XML_ELEMENT_NODE) { - if (!type && !vram && !ram && !heads && + if (!type && !vram && !ram && !heads && !vgamem && xmlStrEqual(cur->name, BAD_CAST "model")) { 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) { @@ -9490,6 +9506,24 @@ virDomainVideoDefParseXML(xmlNodePtr node, def->vram = virDomainVideoDefaultRAM(dom, def->type); } + if (vgamem) { + if (def->type != VIR_DOMAIN_VIDEO_TYPE_VGA && + def->type != VIR_DOMAIN_VIDEO_TYPE_VMVGA && + def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vgamem attribute only supported " + "for type of vga, vmvga and 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; + } + } else { + def->vgamem = virDomainVideoDefaultVgamem(def->type); + } + if (heads) { if (virStrToLong_ui(heads, NULL, 10, &def->heads) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -9506,6 +9540,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, VIR_FREE(type); VIR_FREE(ram); VIR_FREE(vram); + VIR_FREE(vgamem); VIR_FREE(heads); return def; @@ -9515,6 +9550,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, VIR_FREE(type); VIR_FREE(ram); VIR_FREE(vram); + VIR_FREE(vgamem); VIR_FREE(heads); return NULL; } @@ -12636,6 +12672,7 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_FREE(video); goto error; } + video->vgamem = virDomainVideoDefaultVgamem(video->type); video->vram = virDomainVideoDefaultRAM(def, video->type); video->heads = 1; if (VIR_ALLOC_N(def->videos, 1) < 0) { @@ -13558,6 +13595,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"), @@ -16532,6 +16576,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 32674e0..a63ec84 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1216,6 +1216,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; @@ -2459,7 +2460,7 @@ virDomainFSDefPtr virDomainFSRemove(virDomainDefPtr def, size_t i); int virDomainVideoDefaultType(const virDomainDef *def); int virDomainVideoDefaultRAM(const virDomainDef *def, int type); - +int virDomainVideoDefaultVgamem(int type); int virDomainObjListNumOfDomains(virDomainObjListPtr doms, bool active, virDomainObjListFilter filter, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e59ea4c..18d5c17 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -434,6 +434,7 @@ virDomainVcpuPinDel; virDomainVcpuPinFindByVcpu; virDomainVcpuPinIsDuplicate; virDomainVideoDefaultRAM; +virDomainVideoDefaultVgamem; virDomainVideoDefaultType; virDomainVideoDefFree; virDomainVideoTypeFromString; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 2185ef4..cb6d6e2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4812,6 +4812,13 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, virBufferAsprintf(&buf, ",vram_size=%u", video->vram * 1024); } + /* 1. Ignore cirrus-vga as guests would not use it anyway. + * 2. QEMU accepts MByte for vgamem_mb and ensure its value + * a power of two and range: 1 MB -> 256 MB */ + if (video->type != VIR_DOMAIN_VIDEO_TYPE_CIRRUS) { + virBufferAsprintf(&buf, ",vgamem_mb=%u", video->vgamem / 1024); + } + if (qemuBuildDeviceAddressStr(&buf, def, &video->info, qemuCaps) < 0) goto error; @@ -8499,36 +8506,55 @@ qemuBuildCommandLine(virConnectPtr conn, virCommandAddArgList(cmd, "-vga", vgastr, NULL); - 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"); + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { + const char *dev = NULL; int ram = def->videos[0]->ram; int vram = def->videos[0]->vram; + switch (primaryVideoType) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA) + ? "VGA" : NULL); + break; + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA) + ? "vmware-svga" : NULL); + break; + case VIR_DOMAIN_VIDEO_TYPE_QXL: + dev = (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA) + ? "qxl-vga" : "qxl"); + if (vram > (UINT_MAX / 1024)) { + virReportError(VIR_ERR_OVERFLOW, + _("value for 'vram' must be less than '%u'"), + UINT_MAX / 1024); + goto error; + } + if (ram > (UINT_MAX / 1024)) { + virReportError(VIR_ERR_OVERFLOW, + _("value for 'ram' must be less than '%u'"), + UINT_MAX / 1024); + goto error; + } - if (vram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, - _("value for 'vram' must be less than '%u'"), - UINT_MAX / 1024); - goto error; - } - if (ram > (UINT_MAX / 1024)) { - virReportError(VIR_ERR_OVERFLOW, - _("value for 'ram' must be less than '%u'"), - UINT_MAX / 1024); - goto error; - } + if (ram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.ram_size=%u", + dev, ram * 1024); + } + if (vram) { + virCommandAddArg(cmd, "-global"); + virCommandAddArgFormat(cmd, "%s.vram_size=%u", + dev, vram * 1024); + } - if (ram) { - virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.ram_size=%u", - dev, ram * 1024); + break; } - if (vram) { + + if (dev) { + /* QEMU accepts MByte for vgamem_mb and ensure its value + * a power of two and range: 1 MB -> 256 MB */ virCommandAddArg(cmd, "-global"); - virCommandAddArgFormat(cmd, "%s.vram_size=%u", - dev, vram * 1024); + virCommandAddArgFormat(cmd, "%s.vgamem_mb=%u", + dev, def->videos[0]->vgamem / 1024); } } } @@ -11497,6 +11523,7 @@ qemuParseCommandLine(virCapsPtr qemuCaps, vid->type = VIR_DOMAIN_VIDEO_TYPE_XEN; else vid->type = video; + vid->vgamem = virDomainVideoDefaultVgamem(vid->type); vid->vram = virDomainVideoDefaultRAM(def, vid->type); vid->ram = vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL ? virDomainVideoDefaultRAM(def, vid->type) : 0; -- 1.7.12.4

On 14.07.2014 13:20, Wang Rui wrote:
From: Zeng Junliang <zengjunliang@huawei.com>
This patch introduces vgamem attribute for video model, and sets its default value as qemu used. Parse it in two ways accroding to qemu startup parameters supported: -device or -vga.
Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- src/conf/domain_conf.c | 48 ++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 3 +- src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 75 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 101 insertions(+), 26 deletions(-)
missing docs and RNG schema adjustment. And I'd introduce a new XML to test too.
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 63d97ec..d5a65c3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9328,6 +9328,20 @@ virDomainVideoDefaultRAM(const virDomainDef *def, } }
+int +virDomainVideoDefaultVgamem(int type) +{ + switch (type) { + case VIR_DOMAIN_VIDEO_TYPE_VGA: + case VIR_DOMAIN_VIDEO_TYPE_VMVGA: + case VIR_DOMAIN_VIDEO_TYPE_QXL: + /* QEMU use 16M as default value for vga/vmvga/qxl device*/ + return 16 * 1024; + + default: + return 0; + } +}
int virDomainVideoDefaultType(const virDomainDef *def) @@ -9413,6 +9427,7 @@ virDomainVideoDefParseXML(xmlNodePtr node, char *type = NULL; char *heads = NULL; char *vram = NULL; + char *vgamem = NULL; char *ram = NULL; char *primary = NULL;
@@ -9422,11 +9437,12 @@ virDomainVideoDefParseXML(xmlNodePtr node, cur = node->children; while (cur != NULL) { if (cur->type == XML_ELEMENT_NODE) { - if (!type && !vram && !ram && !heads && + if (!type && !vram && !ram && !heads && !vgamem && xmlStrEqual(cur->name, BAD_CAST "model")) { 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) { @@ -9490,6 +9506,24 @@ virDomainVideoDefParseXML(xmlNodePtr node, def->vram = virDomainVideoDefaultRAM(dom, def->type); }
+ if (vgamem) { + if (def->type != VIR_DOMAIN_VIDEO_TYPE_VGA && + def->type != VIR_DOMAIN_VIDEO_TYPE_VMVGA && + def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vgamem attribute only supported " + "for type of vga, vmvga and qxl")); + goto error; + }
Spaces at EOL
+ if (virStrToLong_ui(vgamem, NULL, 10, &def->vgamem) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("cannot parse video vgamem '%s'"), vgamem); + goto error; + } + } else { + def->vgamem = virDomainVideoDefaultVgamem(def->type); + } +
And again. But I'm wondering how's vgamem different to vram. If it covers the same attribute but for different models, I'd vote for keeping already existing attribute name. Michal

On 2014/7/24 17:40, Michal Privoznik wrote:
--- src/conf/domain_conf.c | 48 ++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 3 +- src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 75 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 101 insertions(+), 26 deletions(-)
missing docs and RNG schema adjustment. And I'd introduce a new XML to test too.
Thank you for your review. docs and RNG schema are in patch 6/6. Do you mean that docs and source code should be merged into one patch or I missed some other docs?
+ if (vgamem) { + if (def->type != VIR_DOMAIN_VIDEO_TYPE_VGA && + def->type != VIR_DOMAIN_VIDEO_TYPE_VMVGA && + def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("vgamem attribute only supported " + "for type of vga, vmvga and qxl")); + goto error; + }
Spaces at EOL
Sorry. "make syntax-check" shows me the nits.
+ if (virStrToLong_ui(vgamem, NULL, 10, &def->vgamem) < 0) { + virReportError(VIR_ERR_XML_ERROR, + _("cannot parse video vgamem '%s'"), vgamem); + goto error; + } + } else { + def->vgamem = virDomainVideoDefaultVgamem(def->type); + } +
And again.
But I'm wondering how's vgamem different to vram. If it covers the same attribute but for different models, I'd vote for keeping already existing attribute name.
Qxl model has attribute vram_size/vram_size_mb and vgamem_mb in QEMU. Vga model has attribute vgamem_mb in QEMU but not vram_size/vram_size_mb. So I use a new attribute vgamem in libvirt to make variable/attribute name be consistent with QEMU's. IIUC, attributes in libvirt and qemu for different models are shown as below. Before: model libvirt-attribute(xml) qemu-attribute qxl vram vram_size qxl no attribute vgamem_mb vga vram libvirt passes no attribute to qemu; and qemu has no attribute named like vram* vga no attribute vgamem_mb after: model libvirt-attribute(xml) qemu-attribute qxl vram vram_size qxl vgamem vgamem_mb vga vram libvirt passes no attribute to qemu; and qemu has no attribute named like vram* vga vgamem vgamem_mb And so do other models.(I hope my expression is clear.) I think it's less confusion to introduce new attribute vgamem. Gerd Hoffmann's suggestion is almost the same. https://www.redhat.com/archives/libvir-list/2014-June/msg00569.html

On 14.7.2014 13:20, Wang Rui wrote:
From: Zeng Junliang <zengjunliang@huawei.com>
This patch introduces vgamem attribute for video model, and sets its default value as qemu used. Parse it in two ways accroding to qemu startup parameters supported: -device or -vga.
Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- src/conf/domain_conf.c | 48 ++++++++++++++++++++++++++++++- src/conf/domain_conf.h | 3 +- src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 75 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 101 insertions(+), 26 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 63d97ec..d5a65c3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c
[..]
index e59ea4c..18d5c17 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -434,6 +434,7 @@ virDomainVcpuPinDel; virDomainVcpuPinFindByVcpu; virDomainVcpuPinIsDuplicate; virDomainVideoDefaultRAM; +virDomainVideoDefaultVgamem; virDomainVideoDefaultType; virDomainVideoDefFree; virDomainVideoTypeFromString;
Move the virDomainVideoDefaultVgamem after virDomainVideoDefaultType and next time, please build the libvirt before posting patches. Another thing, if you want to use some qemu device option, you should introduce new qemu capability and check if the option is available, so there should be three new capabilities for vga.vgamem_mb, vmvga.vgamem_mb and qxl.vgamem_mb. Pavel

On 2014/7/24 17:48, Pavel Hrdina wrote:
index e59ea4c..18d5c17 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -434,6 +434,7 @@ virDomainVcpuPinDel; virDomainVcpuPinFindByVcpu; virDomainVcpuPinIsDuplicate; virDomainVideoDefaultRAM; +virDomainVideoDefaultVgamem; virDomainVideoDefaultType; virDomainVideoDefFree; virDomainVideoTypeFromString;
Move the virDomainVideoDefaultVgamem after virDomainVideoDefaultType and next time, please build the libvirt before posting patches.
Sorry, my fault. Next time make check and make syntax-check can help me to do better.
Another thing, if you want to use some qemu device option, you should introduce new qemu capability and check if the option is available, so there should be three new capabilities for vga.vgamem_mb, vmvga.vgamem_mb and qxl.vgamem_mb.
OK. Do you mean I should add capability check in virQEMUCapsComputeCmdFlags()? like: if (strstr(help, "vgamem_mb=")) virQEMUCapsSet(qemuCaps, QEMU_CAPS_VGA_VGAMEM_MB);

From: Zeng Junliang <zengjunliang@huawei.com> Secondary-vga is supported by QEMU in currently master. Add it supported in libvirt as qemu commandline shows: '-device secondary-vga'. Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- src/conf/domain_conf.c | 16 ++++++++------ src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 50 ++++++++++++++++++++++++++++++-------------- 5 files changed, 48 insertions(+), 22 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d5a65c3..216d4e1 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -478,7 +478,8 @@ VIR_ENUM_IMPL(virDomainVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "vmvga", "xen", "vbox", - "qxl") + "qxl", + "secondary") VIR_ENUM_IMPL(virDomainInput, VIR_DOMAIN_INPUT_TYPE_LAST, "mouse", @@ -9335,7 +9336,8 @@ virDomainVideoDefaultVgamem(int type) case VIR_DOMAIN_VIDEO_TYPE_VGA: case VIR_DOMAIN_VIDEO_TYPE_VMVGA: case VIR_DOMAIN_VIDEO_TYPE_QXL: - /* QEMU use 16M as default value for vga/vmvga/qxl device*/ + case VIR_DOMAIN_VIDEO_TYPE_SECONDARY: + /* QEMU use 16M as default value for vga/vmvga/qxl/secondary device*/ return 16 * 1024; default: @@ -9491,10 +9493,11 @@ virDomainVideoDefParseXML(xmlNodePtr node, * for VIR_DOMAIN_VIDEO_TYPE_VMVGA. Shall we also need * to add judge here? Will it affect other drivers? */ if (def->type == VIR_DOMAIN_VIDEO_TYPE_VGA || - def->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS) { + def->type == VIR_DOMAIN_VIDEO_TYPE_CIRRUS || + def->type == VIR_DOMAIN_VIDEO_TYPE_SECONDARY) { virReportError(VIR_ERR_XML_ERROR, "%s", _("vram attribute is not supported " - "for type of vga and cirrus")); + "for type of vga, cirrus, qxl and secondary")); goto error; } if (virStrToLong_ui(vram, NULL, 10, &def->vram) < 0) { @@ -9509,10 +9512,11 @@ virDomainVideoDefParseXML(xmlNodePtr node, if (vgamem) { if (def->type != VIR_DOMAIN_VIDEO_TYPE_VGA && def->type != VIR_DOMAIN_VIDEO_TYPE_VMVGA && - def->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + def->type != VIR_DOMAIN_VIDEO_TYPE_QXL && + def->type != VIR_DOMAIN_VIDEO_TYPE_SECONDARY) { virReportError(VIR_ERR_XML_ERROR, "%s", _("vgamem attribute only supported " - "for type of vga, vmvga and qxl")); + "for type of vga, vmvga, qxl and secondary")); goto error; } if (virStrToLong_ui(vgamem, NULL, 10, &def->vgamem) < 0) { diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index a63ec84..bf1bd55 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1199,6 +1199,7 @@ typedef enum { VIR_DOMAIN_VIDEO_TYPE_XEN, VIR_DOMAIN_VIDEO_TYPE_VBOX, VIR_DOMAIN_VIDEO_TYPE_QXL, + VIR_DOMAIN_VIDEO_TYPE_SECONDARY, VIR_DOMAIN_VIDEO_TYPE_LAST } virDomainVideoType; diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index c665e2b..68b86dc 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -259,6 +259,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST, "msg-timestamp", "active-commit", "change-backing-file", + "secondary-vga", ); @@ -1451,6 +1452,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "spicevmc", QEMU_CAPS_DEVICE_SPICEVMC }, { "qxl-vga", QEMU_CAPS_DEVICE_QXL_VGA }, { "qxl", QEMU_CAPS_DEVICE_QXL }, + { "secondary-vga", QEMU_CAPS_DEVICE_SECONDARY_VGA }, { "sga", QEMU_CAPS_SGA }, { "scsi-block", QEMU_CAPS_SCSI_BLOCK }, { "scsi-cd", QEMU_CAPS_SCSI_CD }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 99cf9ed..73c45d7 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -209,6 +209,7 @@ typedef enum { QEMU_CAPS_MSG_TIMESTAMP = 167, /* -msg timestamp */ QEMU_CAPS_ACTIVE_COMMIT = 168, /* block-commit works without 'top' */ QEMU_CAPS_CHANGE_BACKING_FILE = 169, /* change name of backing file in metadata */ + QEMU_CAPS_DEVICE_SECONDARY_VGA = 170, /* -device secondary-vga */ QEMU_CAPS_LAST, /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index cb6d6e2..3a6762c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -109,7 +109,9 @@ VIR_ENUM_IMPL(qemuVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "vmware", "", /* no arg needed for xen */ "", /* don't support vbox */ - "qxl"); + "qxl", + ""); /* '-vga XXX' for secondary-vga device + * is currently not supported with QEMU */ VIR_ENUM_DECL(qemuDeviceVideo) @@ -119,7 +121,8 @@ VIR_ENUM_IMPL(qemuDeviceVideo, VIR_DOMAIN_VIDEO_TYPE_LAST, "vmware-svga", "", /* no device for xen */ "", /* don't support vbox */ - "qxl-vga"); + "qxl-vga", + "secondary-vga"); VIR_ENUM_DECL(qemuSoundCodec) @@ -2256,9 +2259,11 @@ qemuAssignDevicePCISlots(virDomainDefPtr def, } /* Further non-primary video cards which have to be qxl type */ for (i = 1; i < def->nvideos; i++) { - if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL + && def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_SECONDARY) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("non-primary video device must be type of 'qxl'")); + _("non-primary video device must be " + "type of 'qxl' or 'secondary'")); goto error; } if (def->videos[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) @@ -4774,19 +4779,29 @@ qemuBuildDeviceVideoStr(virDomainDefPtr def, goto error; } } else { - if (video->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("non-primary video device must be type of 'qxl'")); - goto error; - } - - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { + switch (video->type) { + case VIR_DOMAIN_VIDEO_TYPE_QXL: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("only one video card is currently supported")); + goto error; + } + model = "qxl"; + break; + case VIR_DOMAIN_VIDEO_TYPE_SECONDARY: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SECONDARY_VGA)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + "%s", _("only one video card is currently supported")); + goto error; + } + model = "secondary-vga"; + break; + default: virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - "%s", _("only one video card is currently supported")); + "%s", _("non-primary video device must be " + "type of 'qxl' or 'secondary'")); goto error; } - - model = "qxl"; } virBufferAsprintf(&buf, "%s,id=%s", model, video->info.alias); @@ -8474,7 +8489,9 @@ qemuBuildCommandLine(virConnectPtr conn, (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_VMVGA && virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMWARE_SVGA)) || (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_QXL && - virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA))) + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_QXL_VGA)) || + (primaryVideoType == VIR_DOMAIN_VIDEO_TYPE_SECONDARY && + virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_SECONDARY_VGA))) ) { for (i = 0; i < def->nvideos; i++) { char *str; @@ -8563,7 +8580,8 @@ qemuBuildCommandLine(virConnectPtr conn, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE)) { for (i = 1; i < def->nvideos; i++) { char *str; - if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL) { + if (def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_QXL + && def->videos[i]->type != VIR_DOMAIN_VIDEO_TYPE_SECONDARY) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("video type %s is only valid as primary video card"), virDomainVideoTypeToString(def->videos[0]->type)); -- 1.7.12.4

On 14.7.2014 13:20, Wang Rui wrote:
From: Zeng Junliang <zengjunliang@huawei.com>
Secondary-vga is supported by QEMU in currently master. Add it supported in libvirt as qemu commandline shows: '-device secondary-vga'.
Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- src/conf/domain_conf.c | 16 ++++++++------ src/conf/domain_conf.h | 1 + src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 50 ++++++++++++++++++++++++++++++-------------- 5 files changed, 48 insertions(+), 22 deletions(-)
Missing RNG schema adjustments. Pavel

From: Zeng Junliang <zengjunliang@huawei.com> While removing the useless vram attribute for cirrus and stdvga device, we should update the corresponding test cases. Adding test cases for the new vgamem attribute is also needed. Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- .../qemuhotplug-console-compat-2+console-virtio.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-console-compat-2.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-controller-order.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-listen-network2.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl-fullscreen.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-sdl.xml | 2 +- .../qemuxml2argv-graphics-spice-agent-file-xfer.args | 5 +++-- .../qemuxml2argv-graphics-spice-agent-file-xfer.xml | 4 ++-- .../qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml | 2 +- .../qemuxml2argv-graphics-spice-compression.args | 4 +++- .../qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml | 4 ++-- .../qemuxml2argv-graphics-spice-listen-network.xml | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args | 4 +++- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args | 3 ++- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-timeout.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args | 5 +++-- tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-sasl.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-socket.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-tls.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-websocket.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-net-bandwidth.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-idx.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-pci-bridge.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args | 3 ++- tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 3 ++- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args | 4 ++-- tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-device-pciaddr-default.args | 9 ++++++--- .../qemuxml2argv-video-device-pciaddr-default.xml | 6 +++--- .../qemuxml2xmlout-graphics-listen-network2.xml | 2 +- .../qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-idx.xml | 2 +- tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml | 2 +- 44 files changed, 68 insertions(+), 56 deletions(-) diff --git a/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml b/tests/qemuhotplugtestdata/qemuhotplug-console-compat-2+console-virtio.xml index ec1c6e8..6ee2b58 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' 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..bae4ff2a 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' 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..519109f 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' 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..d1ca28c 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' 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..e3e2b46 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' 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..895c76e 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' 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..85dde76 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' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args index 66f22bc..c4089ce 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.args @@ -4,6 +4,7 @@ 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,tls-channel=main,plaintext-channel=inputs,\ 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=67108864,bus=pci.0,addr=0x4 \ +-global qxl-vga.vram_size=33554432 -global qxl-vga.vgamem_mb=16 \ +-device qxl,id=video1,ram_size=67108864,\ +vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.xml index 3a3e366..2574feb 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agent-file-xfer.xml @@ -30,10 +30,10 @@ <filetransfer enable='no'/> </graphics> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='65536' heads='1'/> + <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-agentmouse.xml index 113a236..bad60e8 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' 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..9c87509 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.args @@ -7,5 +7,7 @@ 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 \ --device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \ +-global qxl.vgamem_mb=16 \ +-device qxl,id=video1,ram_size=67108864,\ +vram_size=33554432,vgamem_mb=16,bus=pci.0,addr=0x4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml index 6c913b4..8163020 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-compression.xml @@ -33,10 +33,10 @@ <streaming mode='filter'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-listen-network.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-listen-network.xml index 34971fe..c0ad87c 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-listen-network.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-listen-network.xml @@ -35,10 +35,10 @@ <channel mode='secure' name='usbredir'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args index ef499e6..8a294ed 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.args @@ -4,5 +4,7 @@ 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,tls-channel=main,plaintext-channel=inputs -vga \ qxl -global qxl-vga.ram_size=67108864 -global qxl-vga.vram_size=33554432 \ --device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x4 \ +-global qxl-vga.vgamem_mb=16 \ +-device qxl,id=video1,ram_size=67108864,\ +vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml index acf3019..a12206b 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-qxl-vga.xml @@ -30,10 +30,10 @@ <channel name='inputs' mode='insecure'/> </graphics> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='65536' heads='1'/> + <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args index 8847bce..614fada 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-sasl.args @@ -6,4 +6,5 @@ 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=18874368 -global qxl.vgamem_mb=16 \ +-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..2181f8e 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='18432' vgamem='16384' 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 e6ecbed..deab263 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' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args index 8430d9c..93bb0dc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args @@ -8,6 +8,7 @@ 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 \ --device qxl,id=video1,ram_size=67108864,vram_size=33554432,bus=pci.0,addr=0x4 \ +-global qxl.vram_size=18874368 -global qxl.vgamem_mb=16 \ +-device qxl,id=video1,ram_size=67108864,\ +vram_size=33554432,vgamem_mb=16,bus=pci.0,addr=0x4 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml index 8f58149..9396056 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml @@ -37,10 +37,10 @@ <filetransfer enable='no'/> </graphics> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' ram='65536' vram='32768' heads='1'/> + <model type='qxl' ram='65536' vram='32768' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-policy.xml index 694343f..8e5b17b 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' 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..30437d3 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' 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..f58c237 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' 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..30437d3 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' 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..0c27493 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' 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..b6f49e8 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' 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..9f82580 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' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml b/tests/qemuxml2argvdata/qemuxml2argv-pci-autoadd-addr.xml index 92db5e6..a1cef80 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' 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..881f3e0 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' 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..d2771e5 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' 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..8c5f01a 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.args @@ -6,4 +6,5 @@ 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=18874368 \ +-global qxl.vgamem_mb=16 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml index ee151be..68f78a4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-pcihole64-q35.xml @@ -26,7 +26,7 @@ <controller type='pci' index='2' model='pci-bridge'/> <controller type='sata' index='0'/> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml b/tests/qemuxml2argvdata/qemuxml2argv-pseries-disk.xml index 1f896f8..71c844e 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' heads='1'/> </video> <memballoon model='none'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.args b/tests/qemuxml2argvdata/qemuxml2argv-q35.args index 8cc5874..f74bc01 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-q35.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-q35.args @@ -5,4 +5,5 @@ 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=18874368 \ +-global qxl.vgamem_mb=16 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-q35.xml b/tests/qemuxml2argvdata/qemuxml2argv-q35.xml index edaf6cb..478d23f 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='18432' vgamem='16384' 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..3632421 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.args @@ -8,6 +8,6 @@ LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=spice \ -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 \ +-device qxl-vga,id=video0,ram_size=67107840,\ +vram_size=67107840,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-serial-spiceport.xml b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml index 36af468..47fabe9 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-serial-spiceport.xml @@ -37,7 +37,7 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='qxl' ram='65535' vram='65535' heads='1'/> + <model type='qxl' ram='65535' vram='65535' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'/> </devices> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args b/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args index 4abd7c2..4dbbbfd 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.args @@ -3,7 +3,10 @@ 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 \ -usb \ -hda /var/lib/libvirt/images/QEMUGuest1 -vnc 127.0.0.1:-5900 \ --device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x3 \ --device qxl,id=video1,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x4 \ --device qxl,id=video2,ram_size=67108864,vram_size=67108864,bus=pci.0,addr=0x5 \ +-device qxl-vga,id=video0,ram_size=67108864,\ +vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x3 \ +-device qxl,id=video1,ram_size=67108864,\ +vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x4 \ +-device qxl,id=video2,ram_size=67108864,\ +vram_size=67108864,vgamem_mb=16,bus=pci.0,addr=0x5 \ -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x2 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.xml b/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.xml index 120e7f4..c3f5bcc 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-video-device-pciaddr-default.xml @@ -29,13 +29,13 @@ <listen type='address' address='127.0.0.1'/> </graphics> <video> - <model type='qxl' vram='65536' heads='1'/> + <model type='qxl' vram='65536' vgamem='16384' heads='1'/> </video> <video> - <model type='qxl' vram='65536' heads='1' primary='yes'/> + <model type='qxl' vram='65536' vgamem='16384' heads='1' primary='yes'/> </video> <video> - <model type='qxl' vram='65536' heads='1'/> + <model type='qxl' vram='65536' vgamem='16384' heads='1'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-listen-network2.xml index ae40805..f4103c2 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' 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 44c4cf7..0a18e74 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' vgamem='16384' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-pci-autoadd-addr.xml index 13f0f5d..d8abb9d 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' 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..a4c22e3 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' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml index 96f8eaf..aa24cc8 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-q35.xml @@ -24,7 +24,7 @@ <controller type='pci' index='2' model='pci-bridge'/> <controller type='sata' index='0'/> <video> - <model type='qxl' ram='65536' vram='18432' heads='1'/> + <model type='qxl' ram='65536' vram='18432' vgamem='16384' heads='1'/> </video> <memballoon model='none'/> </devices> -- 1.7.12.4

From: Zeng Junliang <zengjunliang@huawei.com> While adding support for secondary-vga, we should add test cases for it and test its basic functions. Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 ++++++++++++++++++++++ .../qemuxml2argv-graphics-vnc-secondary-vga.args | 7 ++++ .../qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 ++++++++++++++++++++++ tests/qemuxml2argvtest.c | 10 +++--- tests/qemuxml2xmltest.c | 1 + 5 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 qemuxml2argv-graphics-vnc-secondary-vga.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.xml diff --git a/qemuxml2argv-graphics-vnc-secondary-vga.xml b/qemuxml2argv-graphics-vnc-secondary-vga.xml new file mode 100644 index 0000000..d43cf36 --- /dev/null +++ b/qemuxml2argv-graphics-vnc-secondary-vga.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>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='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='usb' index='0'/> + <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' 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='secondary' vgamem='16384' heads='1'/> + </video> + <video> + <model type='secondary' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.args b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.args new file mode 100644 index 0000000..305c76a --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.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 214 -smp 1 -nodefaults -monitor unix:/tmp/test-monitor,\ +server,nowait -no-acpi -boot c -usb -hda /dev/HostVG/QEMUGuest1 \ +-vnc '[2001:1:2:3:4:5:1234:1234]:3' \ +-device secondary-vga,id=video0,vgamem_mb=16,bus=pci.0,addr=0x2 \ +-device secondary-vga,id=video1,vgamem_mb=16,bus=pci.0,addr=0x4 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.xml b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.xml new file mode 100644 index 0000000..d43cf36 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.xml @@ -0,0 +1,39 @@ +<domain type='qemu'> + <name>QEMUGuest1</name> + <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid> + <memory unit='KiB'>219100</memory> + <currentMemory unit='KiB'>219100</currentMemory> + <vcpu placement='static'>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='block' device='disk'> + <driver name='qemu' type='raw'/> + <source dev='/dev/HostVG/QEMUGuest1'/> + <target dev='hda' bus='ide'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> + </disk> + <controller type='usb' index='0'/> + <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' 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='secondary' vgamem='16384' heads='1'/> + </video> + <video> + <model type='secondary' vgamem='16384' heads='1'/> + </video> + <memballoon model='virtio'/> + </devices> +</domain> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a841adb..5e75e8f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -291,7 +291,6 @@ static int testCompareXMLToArgvFiles(const char *xml, goto ok; goto out; } - if (!virDomainDefCheckABIStability(vmdef, vmdef)) { fprintf(stderr, "ABI stability check failed on %s", xml); goto out; @@ -327,7 +326,6 @@ static int testCompareXMLToArgvFiles(const char *xml, goto out; } } - log = virtTestLogContentAndReset(); VIR_FREE(log); virResetLastError(); @@ -354,7 +352,6 @@ static int testCompareXMLToArgvFiles(const char *xml, if (qemuTranslateDiskSourcePool(conn, vmdef->disks[i]) < 0) goto out; } - if (!(cmd = qemuBuildCommandLine(conn, &driver, vmdef, &monitor_chr, (flags & FLAG_JSON), extraFlags, migrateFrom, migrateFd, NULL, @@ -374,7 +371,6 @@ static int testCompareXMLToArgvFiles(const char *xml, fprintf(stderr, "qemuBuildCommandLine should have failed\n"); goto out; } - if (!virtTestOOMActive() && (!!virGetLastError() != !!(flags & FLAG_EXPECT_ERROR))) { if (virTestGetDebug() && (log = virtTestLogContentAndReset())) @@ -384,13 +380,11 @@ static int testCompareXMLToArgvFiles(const char *xml, if (!(actualargv = virCommandToString(cmd))) goto out; - len = virtTestLoadFile(cmdline, &expectargv); if (len < 0) goto out; if (len && expectargv[len - 1] == '\n') expectargv[len - 1] = '\0'; - if (STRNEQ(expectargv, actualargv)) { virtTestDifference(stderr, expectargv, actualargv); goto out; @@ -858,6 +852,10 @@ mymain(void) QEMU_CAPS_SCSI_LSI, QEMU_CAPS_VIRTIO_SCSI); DO_TEST("graphics-vnc", QEMU_CAPS_VNC); + DO_TEST("graphics-vnc-secondary-vga", + QEMU_CAPS_VNC, QEMU_CAPS_DEVICE, + QEMU_CAPS_DEVICE_SECONDARY_VGA, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY); DO_TEST("graphics-vnc-socket", QEMU_CAPS_VNC); DO_TEST("graphics-vnc-websocket", QEMU_CAPS_VNC, QEMU_CAPS_VNC_WEBSOCKET); DO_TEST("graphics-vnc-policy", QEMU_CAPS_VNC, QEMU_CAPS_VNC_SHARE_POLICY); diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 26e3cad..9d19e58 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -231,6 +231,7 @@ mymain(void) DO_TEST_FULL("disk-mirror", true, WHEN_INACTIVE); DO_TEST("graphics-listen-network"); DO_TEST("graphics-vnc"); + DO_TEST("graphics-vnc-secondary-vga"); DO_TEST("graphics-vnc-websocket"); DO_TEST("graphics-vnc-sasl"); DO_TEST("graphics-vnc-tls"); -- 1.7.12.4

From: Zeng Junliang <zengjunliang@huawei.com> Enhance schema. Add description for vgamem attribute and secondary-vga. Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- docs/formatdomain.html.in | 39 ++++++++++++++++++++++++++------------- docs/schemas/domaincommon.rng | 5 +++++ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index b69da4c..98dca4c 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -4272,7 +4272,7 @@ qemu-kvm -net nic,model=? /dev/null ... <devices> <video> - <model type='vga' vram='8192' heads='1'> + <model type='vga' vgamem='16384' heads='1'> <acceleration accel3d='yes' accel2d='yes'/> </model> </video> @@ -4287,28 +4287,41 @@ qemu-kvm -net nic,model=? /dev/null 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 + <code>type</code> with value "cirrus", <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" or "secondary". 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. + secondary bar size. If "ram", "vram" or "vgamem" are not supplied + a default value is used. </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>) + "vbox", "qxl" (<span class="since">since 0.8.6</span>), or + "secondary" (<span class="since">since 1.2.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> + <code>vram</code> attribute specifies the amount of video memory + in kibibytes (blocks of 1024 bytes). It is invalid for type of + "cirrus" or "vga". + </p> + <p> + <code>vgamem</code> attribute <span class="since">since 1.2.6, + QEMU and KVM only</span> specifies the size of the framebuffer + portion of the "ram" region. + And it is only valid for type of "vga", "vmvga", "qxl", + and "secondary". + </p> + <p> + <code>heads</code> attribute specifies the number of screen. + </p> </dd> <dt><code>acceleration</code></dt> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 7be028d..cb272ca 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2708,6 +2708,11 @@ </attribute> </optional> <optional> + <attribute name="vgamem"> + <ref name="unsignedInt"/> + </attribute> + </optional> + <optional> <attribute name="heads"> <ref name="unsignedInt"/> </attribute> -- 1.7.12.4

On 14.7.2014 13:20, Wang Rui wrote:
From: Zeng Junliang <zengjunliang@huawei.com>
Enhance schema. Add description for vgamem attribute and secondary-vga.
Signed-off-by: Zeng Junliang <zengjunliang@huawei.com> Signed-off-by: Wang Rui <moon.wangrui@huawei.com> --- docs/formatdomain.html.in | 39 ++++++++++++++++++++++++++------------- docs/schemas/domaincommon.rng | 5 +++++ 2 files changed, 31 insertions(+), 13 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
[..]
<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>) + "vbox", "qxl" (<span class="since">since 0.8.6</span>), or + "secondary" (<span class="since">since 1.2.6</span>)
Use spaces instead of tab.
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> + <code>vram</code> attribute specifies the amount of video memory + in kibibytes (blocks of 1024 bytes). It is invalid for type of + "cirrus" or "vga".
Same here Pavel

On 2014/7/14 19:20, Wang Rui wrote:
From: Zeng Junliang <zengjunliang@huawei.com>
https://www.redhat.com/archives/libvir-list/2014-June/msg00569.html
ping ...
diff to v1: - Rmoving the confusing vram attribute for cirrus and stdvga. - leave out cirrus for the new vgamem attribute. - add secondary-vga supports and some other docs and tests.
Zeng Junliang (6): qemu: Remove vram attribute in some cases qemu: Introduce vgamem attribute for video model qemu: Add support for secondary-vga tests: modify test case related to vgamem attribute tests: Add test cases for secondary-vga docs: add description for vgamem attribute and secondary-vga
docs/formatdomain.html.in | 39 ++++--- docs/schemas/domaincommon.rng | 5 + qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 +++++++ src/conf/domain_conf.c | 71 ++++++++++-- src/conf/domain_conf.h | 4 +- src/libvirt_private.syms | 1 + src/qemu/qemu_capabilities.c | 2 + src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 125 ++++++++++++++------- ...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 +- ...emuxml2argv-graphics-spice-agent-file-xfer.args | 5 +- ...qemuxml2argv-graphics-spice-agent-file-xfer.xml | 4 +- .../qemuxml2argv-graphics-spice-agentmouse.xml | 2 +- .../qemuxml2argv-graphics-spice-compression.args | 4 +- .../qemuxml2argv-graphics-spice-compression.xml | 4 +- .../qemuxml2argv-graphics-spice-listen-network.xml | 4 +- .../qemuxml2argv-graphics-spice-qxl-vga.args | 4 +- .../qemuxml2argv-graphics-spice-qxl-vga.xml | 4 +- .../qemuxml2argv-graphics-spice-sasl.args | 3 +- .../qemuxml2argv-graphics-spice-sasl.xml | 2 +- .../qemuxml2argv-graphics-spice-timeout.xml | 2 +- .../qemuxml2argv-graphics-spice.args | 5 +- .../qemuxml2argv-graphics-spice.xml | 4 +- .../qemuxml2argv-graphics-vnc-policy.xml | 2 +- .../qemuxml2argv-graphics-vnc-sasl.xml | 2 +- .../qemuxml2argv-graphics-vnc-secondary-vga.args | 7 ++ .../qemuxml2argv-graphics-vnc-secondary-vga.xml | 39 +++++++ .../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 | 3 +- .../qemuxml2argv-pcihole64-q35.xml | 2 +- .../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 2 +- tests/qemuxml2argvdata/qemuxml2argv-q35.args | 3 +- tests/qemuxml2argvdata/qemuxml2argv-q35.xml | 2 +- .../qemuxml2argv-serial-spiceport.args | 4 +- .../qemuxml2argv-serial-spiceport.xml | 2 +- .../qemuxml2argv-video-device-pciaddr-default.args | 9 +- .../qemuxml2argv-video-device-pciaddr-default.xml | 6 +- tests/qemuxml2argvtest.c | 10 +- .../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/qemuxml2xmltest.c | 1 + 57 files changed, 345 insertions(+), 123 deletions(-) create mode 100644 qemuxml2argv-graphics-vnc-secondary-vga.xml create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-graphics-vnc-secondary-vga.xml
participants (3)
-
Michal Privoznik
-
Pavel Hrdina
-
Wang Rui