aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Fantoni <fabio.fantoni@heliman.it>2013-03-01 13:22:21 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-03-04 17:30:51 +0000
commit18718c3abd4e287844004b7a988704ecdb71c682 (patch)
tree8834761af01a34aa6cfed7bf551f7fae23c470b1
parent3f5e3cd97398468d624cf907979c2bb12ff7ee7e (diff)
downloadxen-18718c3abd4e287844004b7a988704ecdb71c682.tar.gz
xen-18718c3abd4e287844004b7a988704ecdb71c682.tar.bz2
xen-18718c3abd4e287844004b7a988704ecdb71c682.zip
tools/libxl: Improve videoram setting
- If videoram setting is less than 8 mb shows error and exit. - Added videoram setting for qemu upstream with cirrus (added in qemu 1.3). - Updated xl.cfg man. - Default and minimal videoram changed to 16 mb if stdvga is set and upstream qemu is being used. This is required by qemu 1.4 to avoid a xen memory error (qemu 1.3 doesn't complain about it, probably buggy). Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com> Cherry picked from xen-unstable 2e814a017155b885e4d4b5a88dc05e7367a9722a, backport as follows: Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
-rw-r--r--docs/man/xl.cfg.pod.514
-rw-r--r--tools/libxl/libxl_create.c20
-rw-r--r--tools/libxl/libxl_dm.c6
3 files changed, 29 insertions, 11 deletions
diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a8b635b539..4f7b583a4f 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -739,19 +739,15 @@ 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. This option is only available when using the B<stdvga>
-option (see below).
+available.
The default amount of video ram for stdvga is 8MB which is sufficient
-for e.g. 1600x1200 at 32bpp.
+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<stdvga=0>)
the amount of video ram is fixed at 4MB which is sufficient
-for 1024x768 at 32 bpp.
-
-videoram option is currently only available when using the
-qemu-xen-traditional device-model. Upstream qemu-xen device-model
-currently doesn't support changing the amount of video memory
-for the emulated graphics device.
+for 1024x768 at 32 bpp and videoram option is currently working
+only when using the upstream qemu-xen device-model.
=item B<stdvga=BOOLEAN>
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 89f4e0a58b..e9a5148713 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -232,8 +232,24 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
case LIBXL_DOMAIN_TYPE_HVM:
if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
b_info->shadow_memkb = 0;
- if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
- b_info->video_memkb = 8 * 1024;
+
+ 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->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");
+ 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;
+ }
+
if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
b_info->u.hvm.timer_mode =
LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 7662b3d13b..423e4a4fcb 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -435,6 +435,12 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
break;
case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
flexarray_vappend(dm_args, "-vga", "cirrus", NULL);
+ if (b_info->video_memkb) {
+ flexarray_vappend(dm_args, "-global",
+ libxl__sprintf(gc, "vga.vram_size_mb=%d",
+ libxl__sizekb_to_mb(b_info->video_memkb)),
+ NULL);
+ }
break;
}