From: Ian Campbell <ian.campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: libxl videoram for cirrus graphics
Date: Tue, 17 Sep 2013 15:04:13 +0100 [thread overview]
Message-ID: <1379426653.11304.102.camel@hastur.hellion.org.uk> (raw)
In-Reply-To: <360717C0B01E6345BCBE64B758E22C2D102F43@AMSPEX01CL03.citrite.net>
On Tue, 2013-09-17 at 14:29 +0100, Rob Hoes wrote:
>
> > -----Original Message-----
> > From: Ian Campbell [mailto:ian.campbell@citrix.com]
> > Sent: 17 September 2013 2:18 PM
> > To: Rob Hoes
> > Cc: xen-devel@lists.xen.org; Stefano Stabellini; Ian Jackson
> > Subject: Re: [Xen-devel] libxl videoram for cirrus graphics
> >
> > On Tue, 2013-09-17 at 12:54 +0000, Rob Hoes wrote:
> > > Hi,
> > >
> > > The videoram setting in xl config files is documented as follows:
> > >
> > > "
> > > videoram=MBYTES
> > >
> > > Sets the amount of RAM which the emulated video card will contain,
> > > which in turn limits the resolutions and bit depths which will be
> > > available. The default amount of video ram for stdvga is 8MB which is
> > > sufficient for e.g. 1600x1200 at 32bpp and videoram option is
> > > currently working only when using the qemu-xen-traditional
> > > device-model.
> > >
> > > When using the emulated Cirrus graphics card (vga="cirrus") the
> > > amount of video ram is fixed at 4MB which is sufficient for 1024x768
> > > at 32 bpp and videoram option is currently working only when using the
> > > upstream qemu-xen device-model.
> > > "
> > >
> > > XenServer also uses a default of 4MB video ram for cirrus graphics.
> > >
> > > However, when I use xl to create a VM with cirrus graphics, I get 8MB
> > > of video RAM by default. Moreover, setting it to videoram=4 in the
> > > config file leads to complaints from libxl:
> > >
> > > libxl_create.c:228:libxl__domain_build_info_setdefault: videoram
> > > must be at least 8 mb
> > >
> > > Is there a bug in the logic in libxl_create.c?
> >
> > Either the docs of the code or both would seem to be wrong. Since you say
> > you happily use 4MB in XenServer I guess it is both?
> >
> > I noticed that the docs also say the amount is fixed, but that's not what the
> > code implements either..
>
> Yes, as far as I can see, XenServer has always used 4MB by default, and allows one to override it as well (so the amount is not fixed). Not allowing 4MB anymore, as well as not allowing the override, may therefore lead to upgrade problems for XenServer users when we switch to using libxl, so I am hoping that we can make the checks in libxl a little less strict.
>
> I think that something like this would work:
>
> diff -r ba248e555458 tools/libxl/libxl_create.c
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -213,8 +213,13 @@
> if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
> b_info->shadow_memkb = 0;
>
> - if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_STD &&
> - b_info->device_model_version ==
> + if (!b_info->u.hvm.vga.kind)
> + b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
> +
> + if (b_info->u.hvm.vga.kind == LIBXL_VGA_INTERFACE_TYPE_CIRRUS) {
> + if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
> + b_info->video_memkb = 4 * 1024;
> + } else if (b_info->device_model_version ==
> LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
> if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
> b_info->video_memkb = 16 * 1024;
Do the following checks for b_info->video_memkb == LIBXL_MEMKB_DEFAULT
and b_info->video_memkb < (8 * 1024) not need modifying then?
Is the behaviour here any different to just changing the 8s into 4s?
Can you also update the docs, it's at least wrong about the 4MB being a
fixed value.
> @@ -251,8 +256,6 @@
> if (!b_info->u.hvm.boot) return ERROR_NOMEM;
> }
>
> - if (!b_info->u.hvm.vga.kind)
> - b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
> libxl_defbool_setdefault(&b_info->u.hvm.vnc.enable, true);
> if (libxl_defbool_val(b_info->u.hvm.vnc.enable)) {
> libxl_defbool_setdefault(&b_info->u.hvm.vnc.findunused, true);
>
> > I'm not really sure who, if anyone, might know definitively what is going on
> > here. Stefano has some involvement in this video mem stuff once upon a
> > time and Ian is the qemu-trad maintainer, so I've CCdthem both ;-)
> >
> > >
> > > Cheers,
> > > Rob
> > >
> > > _______________________________________________
> > > Xen-devel mailing list
> > > Xen-devel@lists.xen.org
> > > http://lists.xen.org/xen-devel
> >
>
next prev parent reply other threads:[~2013-09-17 14:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-17 12:54 libxl videoram for cirrus graphics Rob Hoes
2013-09-17 13:17 ` Ian Campbell
2013-09-17 13:29 ` Rob Hoes
2013-09-17 14:04 ` Ian Campbell [this message]
2013-09-17 14:52 ` Rob Hoes
2013-09-17 15:01 ` Ian Campbell
2013-09-20 10:49 ` Stefano Stabellini
2013-09-17 13:24 ` Wei Liu
2013-09-17 14:00 ` Ian Campbell
2013-09-17 17:51 ` Fabio Fantoni
2013-09-17 19:13 ` Ian Campbell
2013-09-17 14:03 ` Frediano Ziglio
2013-09-17 17:00 ` Pasi Kärkkäinen
2013-09-18 13:51 ` Rob Hoes
2013-09-18 9:13 ` Rob Hoes
2013-09-18 9:40 ` Fabio Fantoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379426653.11304.102.camel@hastur.hellion.org.uk \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=Rob.Hoes@citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).