diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2810c05cbc..5dc4b6292e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9953,6 +9953,10 @@ int virDomainVideoDefaultRAM(const virDomainDef *def, int 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: diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 11ae8f933c..4d7a1b772b 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -353,6 +353,25 @@ xenDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, return -1; } + 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; + break; + + case VIR_DOMAIN_VIDEO_TYPE_XEN: + /* Original Xen PVFB hardcoded to 4 MB */ + dev->data.video->vram = 4 * 1024; + break; + + case VIR_DOMAIN_VIDEO_TYPE_QXL: + /* Use 64M as the minimal video video memory for qxl device */ + return 64 * 1024; + } + } + return 0; }