From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Privoznik Subject: Re: [libvirt] [PATCH 2/5] Xen: Defer setting default vram value to Xen drivers Date: Mon, 06 Oct 2014 10:04:09 +0200 Message-ID: <54324CF9.5020303@redhat.com> References: <1411154594-14871-1-git-send-email-jfehlig@suse.com> <1411154594-14871-3-git-send-email-jfehlig@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1411154594-14871-3-git-send-email-jfehlig@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jim Fehlig , libvir-list@redhat.com Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 19.09.2014 21:23, Jim Fehlig wrote: > Allow the Xen drivers to determine default vram values. Sane > default vaules depend on the device model being used, so the > drivers are in the best position to determine the defaults. > > For the legacy xen driver, it is best to maintain the existing > logic for setting default vram values to ensure there are no > regressions. The libxl driver currently does not support > configuring a video device. Support will be added in a > subsequent patch, where the benefit of this change will be > reaped. > > Signed-off-by: Jim Fehlig > --- > src/conf/domain_conf.c | 4 ++++ > src/xen/xen_driver.c | 19 +++++++++++++++++++ > 2 files changed, 23 insertions(+) > > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > index bb4a4cb..1de2650 100644 > --- a/src/conf/domain_conf.c > +++ b/src/conf/domain_conf.c > @@ -9696,6 +9696,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 11ae8f9..7438ebb 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 */ Indentation's off. > + return 64 * 1024; > + } > + } > + > return 0; > } > > Michal