From: Rob Hoes <rob.hoes@citrix.com>
To: xen-devel@lists.xen.org
Cc: Rob Hoes <rob.hoes@citrix.com>,
ian.jackson@eu.citrix.com, ian.campbell@citrix.com,
stefano.stabellini@eu.citrix.com
Subject: [PATCH v2] libxl: Allow 4 MB of video RAM for Cirrus graphics on traditional QEMU
Date: Thu, 24 Oct 2013 16:12:07 +0100 [thread overview]
Message-ID: <1382627527-25399-1-git-send-email-rob.hoes@citrix.com> (raw)
VMs using Cirrus graphics have always had 4 MB of video RAM on XenServer, while
libxl currently does not allow values less than 8 MB.
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
----
v2: Fixed style issues.
---
docs/man/xl.cfg.pod.5 | 18 ++++++++-------
tools/libxl/libxl_create.c | 53 ++++++++++++++++++++++++++++++++++----------
2 files changed, 51 insertions(+), 20 deletions(-)
diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 278dba1..d2d8921 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1028,14 +1028,16 @@ in the B<VFB_SPEC_STRING> for configuring virtual frame buffer devices
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 (B<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.
+
+When using the qemu-xen-traditional device-model, the default as well as
+minimum amount of video RAM for stdvga is 8 MB, which is sufficient for e.g.
+1600x1200 at 32bpp. For the upstream qemu-xen device-model, the default and
+minimum is 16 MB.
+
+When using the emulated Cirrus graphics card (B<vga="cirrus">) and the
+qemu-xen-traditional device-model, the amount of video RAM is fixed at 4 MB,
+which is sufficient for 1024x768 at 32 bpp. For the upstream qemu-xen
+device-model, the default and minimum is 8 MB.
=item B<stdvga=BOOLEAN>
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 1b320d3..9d793ba 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -216,20 +216,51 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
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 ==
- LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
+ if (!b_info->u.hvm.vga.kind)
+ b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+
+ switch (b_info->device_model_version) {
+ case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL:
+ switch (b_info->u.hvm.vga.kind) {
+ case LIBXL_VGA_INTERFACE_TYPE_STD:
+ if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
+ b_info->video_memkb = 8 * 1024;
+ if (b_info->video_memkb < 8 * 1024) {
+ LOG(ERROR, "videoram must be at least 8 MB for STDVGA on QEMU_XEN_TRADITIONAL");
+ return ERROR_INVAL;
+ }
+ break;
+ case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
+ default:
+ if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
+ b_info->video_memkb = 4 * 1024;
+ if (b_info->video_memkb != 4 * 1024)
+ LOG(WARN, "ignoring videoram other than 4 MB for CIRRUS on QEMU_XEN_TRADITIONAL");
+ break;
+ }
+ break;
+ case LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN:
+ default:
+ switch (b_info->u.hvm.vga.kind) {
+ case LIBXL_VGA_INTERFACE_TYPE_STD:
if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
b_info->video_memkb = 16 * 1024;
- else if (b_info->video_memkb < (16 * 1024) ){
- LOG(ERROR, "videoram must be at least 16 mb with stdvga");
+ if (b_info->video_memkb < 16 * 1024) {
+ LOG(ERROR, "videoram must be at least 16 MB for STDVGA on QEMU_XEN");
+ return ERROR_INVAL;
+ }
+ break;
+ case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
+ default:
+ if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
+ b_info->video_memkb = 8 * 1024;
+ if (b_info->video_memkb < 8 * 1024) {
+ LOG(ERROR, "videoram must be at least 8 MB for CIRRUS on QEMU_XEN");
return ERROR_INVAL;
}
- } else if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
- b_info->video_memkb = 8 * 1024;
- else if (b_info->video_memkb < (8 * 1024) ){
- LOG(ERROR,"videoram must be at least 8 mb");
- return ERROR_INVAL;
+ break;
+ }
+ break;
}
if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
@@ -254,8 +285,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
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);
--
1.7.10.4
next reply other threads:[~2013-10-24 15:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-24 15:12 Rob Hoes [this message]
2013-10-26 15:50 ` [PATCH v2] libxl: Allow 4 MB of video RAM for Cirrus graphics on traditional QEMU Stefano Stabellini
2013-10-29 8:49 ` Fabio Fantoni
2013-11-04 17:52 ` Ian Campbell
2013-11-06 9:47 ` Rob Hoes
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=1382627527-25399-1-git-send-email-rob.hoes@citrix.com \
--to=rob.hoes@citrix.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.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).