]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
libxl: Add qxl vga interface support for upstream qemu
authorFabio Fantoni <fabio.fantoni@heliman.it>
Wed, 20 Feb 2013 15:46:06 +0000 (15:46 +0000)
committerFabio Fantoni <fabio.fantoni@heliman.it>
Wed, 20 Feb 2013 15:46:06 +0000 (15:46 +0000)
Usage:
  vga="qxl"

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Signed-off-by: Zhou Peng <zpengxen@gmail.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
docs/man/xl.cfg.pod.5
tools/libxl/libxl_create.c
tools/libxl/libxl_dm.c
tools/libxl/libxl_types.idl
tools/libxl/xl_cmdimpl.c

index 9c5def4e331d48af4a235db53f2aa0471adfe634..25523c99dcc5424a93846652c157befedfbe5481 100644 (file)
@@ -1003,6 +1003,9 @@ 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.
 
+For B<qxl> vga, the default is both default and minimal 128MB.
+If B<videoram> is set less than 128MB, an error will be triggered.
+
 =item B<stdvga=BOOLEAN>
 
 Select a standard VGA card with VBE (VESA BIOS Extensions) as the
@@ -1014,9 +1017,14 @@ This option is deprecated, use vga="stdvga" instead.
 
 =item B<vga="STRING">
 
-Selects the emulated video card (stdvga|cirrus).
+Selects the emulated video card (stdvga|cirrus|qxl).
 The default is cirrus.
 
+In general, QXL should work with the Spice remote display protocol
+for acceleration, and QXL driver is necessary in guest in this case.
+QXL can also work with the VNC protocol, but it will be like a standard
+VGA without acceleration.
+
 =item B<vnc=BOOLEAN>
 
 Allow access to the display via the VNC protocol.  This enables the
index fa81f884d9df226a1569a94a4875263cdb9b60ab..efeebf27fb8c5e4ac40bc36b19a3c8d36254ff1a 100644 (file)
@@ -198,14 +198,29 @@ 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_QXL) {
+            if (b_info->device_model_version ==
+               LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
+                if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT) {
+                    b_info->video_memkb = (128 * 1024);
+                } else if (b_info->video_memkb < (128 * 1024)) {
+                    LOG(ERROR,
+                        "128 Mib videoram is the minimum for qxl default");
+                    return ERROR_INVAL;
+                }
+            } else {
+                LOG(ERROR,"qemu upstream required for qxl vga");
+                return ERROR_INVAL;
+            }
+        }
+
         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");
+                    LOG(ERROR, "videoram must be at least 16 mb with stdvga");
                     return ERROR_INVAL;
                 }
         } else if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
index a2c99bd1246e729e464e13cafdd311efe3689b2d..c4ca11eb90deb9560849a8d338efea0ce2405449 100644 (file)
@@ -181,6 +181,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
             break;
         case LIBXL_VGA_INTERFACE_TYPE_CIRRUS:
             break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            break;
         }
 
         if (b_info->u.hvm.boot) {
@@ -435,9 +437,19 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             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);
+                    GCSPRINTF("vga.vram_size_mb=%d",
+                    libxl__sizekb_to_mb(b_info->video_memkb)), NULL);
+            }
+            break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            /* QXL have 2 ram regions, ram and vram */
+            flexarray_vappend(dm_args, "-vga", "qxl", NULL);
+            if (b_info->video_memkb) {
+                flexarray_vappend(dm_args, "-global",
+                    GCSPRINTF("qxl-vga.vram_size_mb=%lu",
+                    (b_info->video_memkb/2/1024)), "-global",
+                    GCSPRINTF("qxl-vga.ram_size_mb=%lu",
+                    (b_info->video_memkb/2/1024)), NULL);
             }
             break;
         }
index 89a80300fef4e48ceea1127163ac4c90c5065840..5b080ed54810c44259ec577234a8e366488d5315 100644 (file)
@@ -130,6 +130,7 @@ libxl_shutdown_reason = Enumeration("shutdown_reason", [
 libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),
     (2, "STD"),
+    (3, "QXL"),
     ], init_val = 0)
 
 #
index 003b12963d5fcacd180b114997ba8fbf56f9a4a4..a98705e31ad8adec81641fcb9acf56d853329b27 100644 (file)
@@ -1476,14 +1476,13 @@ skip_vfb:
     if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         if (!xlu_cfg_get_string (config, "vga", &buf, 0)) {
             if (!strcmp(buf, "stdvga")) {
-                b_info->u.hvm.vga.kind
-                = LIBXL_VGA_INTERFACE_TYPE_STD;
+                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_STD;
             } else if (!strcmp(buf, "cirrus")) {
-                b_info->u.hvm.vga.kind
-                = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
+            } else if (!strcmp(buf, "qxl")) {
+                b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_QXL;
             } else {
-                fprintf(stderr,
-                "Unknown vga \"%s\" specified\n", buf);
+                fprintf(stderr, "Unknown vga \"%s\" specified\n", buf);
                 exit(1);
             }
         } else if (!xlu_cfg_get_long(config, "stdvga", &l, 0))