From: Zeng Junliang <zengjunliang@xxxxxxxxxx> 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@xxxxxxxxxx> Signed-off-by: Wang Rui <moon.wangrui@xxxxxxxxxx> --- 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 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list