diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b3165fc361ad377602fb958fd3f122bbd540d48e..ed0c471465f3d2a32dc0ea66cef9d907d4569f52 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -4174,6 +4174,12 @@ virDomainDeviceDefPostParseInternal(virDomainDeviceDefPtr dev, if (dev->type == VIR_DOMAIN_DEVICE_VIDEO) { virDomainVideoDefPtr video = dev->data.video; + /* Fill out (V)RAM if the driver-specific callback did not do so */ + if (video->ram == 0 && video->type == VIR_DOMAIN_VIDEO_TYPE_QXL) + video->ram = virDomainVideoDefaultRAM(def, video->type); + if (video->vram == 0) + video->vram = virDomainVideoDefaultRAM(def, video->type); + video->ram = VIR_ROUND_UP_POWER_OF_TWO(video->ram); video->vram = VIR_ROUND_UP_POWER_OF_TWO(video->vram); } @@ -12045,10 +12051,6 @@ unsigned int virDomainVideoDefaultRAM(const virDomainDef *def, const virDomainVideoType type) { - /* Defer setting default vram to the Xen drivers */ - if (def->virtType == VIR_DOMAIN_VIRT_XEN) - return 0; - switch (type) { case VIR_DOMAIN_VIDEO_TYPE_VGA: case VIR_DOMAIN_VIDEO_TYPE_CIRRUS: @@ -12227,8 +12229,6 @@ virDomainVideoDefParseXML(xmlNodePtr node, _("cannot parse video ram '%s'"), ram); goto error; } - } else if (def->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { - def->ram = virDomainVideoDefaultRAM(dom, def->type); } if (vram) { @@ -12237,8 +12237,6 @@ virDomainVideoDefParseXML(xmlNodePtr node, _("cannot parse video vram '%s'"), vram); goto error; } - } else { - def->vram = virDomainVideoDefaultRAM(dom, def->type); } if (vram64) { @@ -18697,7 +18695,6 @@ virDomainDefAddImplicitVideo(virDomainDefPtr def) _("cannot determine default video type")); goto cleanup; } - video->vram = virDomainVideoDefaultRAM(def, video->type); video->heads = 1; if (VIR_APPEND_ELEMENT(def->videos, def->nvideos, video) < 0) goto cleanup; diff --git a/src/qemu/qemu_parse_command.c b/src/qemu/qemu_parse_command.c index 7ce90f926dd534534e839327567b1c512ac9c452..e30586f74b5c81e5565f1cc085bfdbd85a01d671 100644 --- a/src/qemu/qemu_parse_command.c +++ b/src/qemu/qemu_parse_command.c @@ -2583,9 +2583,7 @@ qemuParseCommandLine(virCapsPtr caps, vid->type = VIR_DOMAIN_VIDEO_TYPE_XEN; else vid->type = video; - vid->vram = virDomainVideoDefaultRAM(def, vid->type); if (vid->type == VIR_DOMAIN_VIDEO_TYPE_QXL) { - vid->ram = virDomainVideoDefaultRAM(def, vid->type); vid->vgamem = QEMU_QXL_VGAMEM_DEFAULT; } else { vid->ram = 0;