Commit 6bd69432 authored by Thomas Strobel's avatar Thomas Strobel
Browse files

Xen: enable Spice/QXL + add libhvm + minor fixes

parent 8f911263
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
diff --git a/src/Kconfig b/src/Kconfig
index 45ca59c..faf8951 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -144,13 +144,13 @@ menu "Hardware support"
     config ATA_DMA
         depends on ATA
         bool "ATA DMA"
-        default n
+        default y
         help
             Detect and try to use ATA bus mastering DMA controllers.
     config ATA_PIO32
         depends on ATA
         bool "ATA 32bit PIO"
-        default n
+        default y
         help
             Use 32bit PIO accesses on ATA (minor optimization on PCI 
transfers).
     config AHCI
-- 
1.7.10.4
+104 −0
Original line number Diff line number Diff line
From bd71555985efc423b1a119b6a3177de855763453 Mon Sep 17 00:00:00 2001
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Date: Tue, 20 Jan 2015 11:26:30 +0100
Subject: [PATCH] libxl: Spice image compression setting support for upstream
 qemu

Usage:
spice_image_compression=[auto_glz|auto_lz|quic|glz|lz|off]

Specifies what image compression is to be used by spice (if given),
otherwise the qemu default will be used.

Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5       |  6 ++++++
 tools/libxl/libxl.h         | 11 +++++++++++
 tools/libxl/libxl_dm.c      |  4 ++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/xl_cmdimpl.c    |  2 ++
 5 files changed, 24 insertions(+)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index e2f91fc..0c2cbac 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1427,6 +1427,12 @@ for redirection of up to 4 usb devices from spice client to domU's qemu.
 It requires an usb controller and if not defined it will automatically adds
 an usb2 controller. The default is disabled (0).
 
+=item B<spice_image_compression=[auto_glz|auto_lz|quic|glz|lz|off]>
+
+Specifies what image compression is to be used by spice (if given), otherwise
+the qemu default will be used. Please see documentations of your current qemu
+version for details.
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 0a123f1..b8e0b67 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -528,6 +528,17 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_SPICE_USBREDIREDIRECTION 1
 
 /*
+ * LIBXL_HAVE_SPICE_IMAGECOMPRESSION
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: image_compression. This value defines what Spice image compression
+ * is used.
+ *
+ * If this is not defined, the Spice image compression setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
+
+/*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
  * If this is defined, libxl_domain_create_restore()'s API has changed to
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index c2b0487..40c8649 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -398,6 +398,10 @@ static char *dm_spice_options(libxl__gc *gc,
     if (!libxl_defbool_val(spice->clipboard_sharing))
         opt = libxl__sprintf(gc, "%s,disable-copy-paste", opt);
 
+    if (spice->image_compression)
+        opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
+                             spice->image_compression);
+
     return opt;
 }
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 1214d2e..052ded9 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -241,6 +241,7 @@ libxl_spice_info = Struct("spice_info", [
     ("vdagent",     libxl_defbool),
     ("clipboard_sharing", libxl_defbool),
     ("usbredirection", integer),
+    ("image_compression", string),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 0b02a6c..00aa69d 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1948,6 +1948,8 @@ skip_vfb:
                             &b_info->u.hvm.spice.clipboard_sharing, 0);
         if (!xlu_cfg_get_long (config, "spiceusbredirection", &l, 0))
             b_info->u.hvm.spice.usbredirection = l;
+        xlu_cfg_replace_string (config, "spice_image_compression",
+                                &b_info->u.hvm.spice.image_compression, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru",
                             &b_info->u.hvm.gfx_passthru, 0);
-- 
1.9.2
+104 −0
Original line number Diff line number Diff line
From 296c7f3284efe655d95a8ae045a5dc1a20d6fff0 Mon Sep 17 00:00:00 2001
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Date: Tue, 20 Jan 2015 11:33:17 +0100
Subject: [PATCH] libxl: Spice streaming video setting support for upstream
 qemu

Usage:
spice_streaming_video=[filter|all|off]

Specifies what streaming video setting is to be used by spice (if
given),
otherwise the qemu default will be used.

Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
Acked-by: Wei Liu <wei.liu2@citrix.com>
---
 docs/man/xl.cfg.pod.5       |  5 +++++
 tools/libxl/libxl.h         | 11 +++++++++++
 tools/libxl/libxl_dm.c      |  4 ++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/xl_cmdimpl.c    |  2 ++
 5 files changed, 23 insertions(+)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 0c2cbac..408653f 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1433,6 +1433,11 @@ Specifies what image compression is to be used by spice (if given), otherwise
 the qemu default will be used. Please see documentations of your current qemu
 version for details.
 
+=item B<spice_streaming_video=[filter|all|off]>
+
+Specifies what streaming video setting is to be used by spice (if given),
+otherwise the qemu default will be used.
+
 =back
 
 =head3 Miscellaneous Emulated Hardware
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index b8e0b67..c219f59 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -539,6 +539,17 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
 
 /*
+ * LIBXL_HAVE_SPICE_STREAMINGVIDEO
+ *
+ * If defined, then the libxl_spice_info structure will contain a string type
+ * field: streaming_video. This value defines what Spice streaming video setting
+ * is used.
+ *
+ * If this is not defined, the Spice streaming video setting support is ignored.
+ */
+#define LIBXL_HAVE_SPICE_STREAMINGVIDEO 1
+
+/*
  * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
  *
  * If this is defined, libxl_domain_create_restore()'s API has changed to
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 40c8649..d8d6f0c 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -402,6 +402,10 @@ static char *dm_spice_options(libxl__gc *gc,
         opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
                              spice->image_compression);
 
+    if (spice->streaming_video)
+        opt = libxl__sprintf(gc, "%s,streaming-video=%s", opt,
+                             spice->streaming_video);
+
     return opt;
 }
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 052ded9..02be466 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -242,6 +242,7 @@ libxl_spice_info = Struct("spice_info", [
     ("clipboard_sharing", libxl_defbool),
     ("usbredirection", integer),
     ("image_compression", string),
+    ("streaming_video", string),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 00aa69d..b7eac29 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -1950,6 +1950,8 @@ skip_vfb:
             b_info->u.hvm.spice.usbredirection = l;
         xlu_cfg_replace_string (config, "spice_image_compression",
                                 &b_info->u.hvm.spice.image_compression, 0);
+        xlu_cfg_replace_string (config, "spice_streaming_video",
+                                &b_info->u.hvm.spice.streaming_video, 0);
         xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
         xlu_cfg_get_defbool(config, "gfx_passthru",
                             &b_info->u.hvm.gfx_passthru, 0);
-- 
1.9.2
+165 −0
Original line number Diff line number Diff line
From 161212ef02312c0681d2d809c8ff1e1f0ea6f6f9 Mon Sep 17 00:00:00 2001
From: Fabio Fantoni <fabio.fantoni@m2r.biz>
Date: Wed, 29 Apr 2015 11:20:28 +0200
Subject: [PATCH] libxl: Add qxl vga interface support for upstream qemu

Usage:
vga="qxl"

Qxl vga support many resolutions that not supported by stdvga,
mainly the 16:9 ones and other high up to 2560x1600.
With QXL you can get improved performance and smooth video also
with high resolutions and high quality.
Require their drivers installed in the domU and spice used
otherwise act as a simple stdvga.

Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
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>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---
 docs/man/xl.cfg.pod.5       | 10 +++++++++-
 tools/libxl/libxl.h         | 10 ++++++++++
 tools/libxl/libxl_create.c  | 13 +++++++++++++
 tools/libxl/libxl_dm.c      |  8 ++++++++
 tools/libxl/libxl_types.idl |  1 +
 tools/libxl/xl_cmdimpl.c    |  2 ++
 6 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index f936dfc..8e4154f 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1360,6 +1360,9 @@ 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.
 
+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
@@ -1371,9 +1374,14 @@ This option is deprecated, use vga="stdvga" instead.
 
 =item B<vga="STRING">
 
-Selects the emulated video card (none|stdvga|cirrus).
+Selects the emulated video card (none|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
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 44bd8e2..efc0617 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -535,6 +535,16 @@ typedef struct libxl__ctx libxl_ctx;
 #define LIBXL_HAVE_DOMINFO_OUTSTANDING_MEMKB 1
 
 /*
+ * LIBXL_HAVE_QXL
+ *
+ * If defined, then the libxl_vga_interface_type will contain another value:
+ * "QXL". This value define if qxl vga is supported.
+ *
+ * If this is not defined, the qxl vga support is missed.
+ */
+#define LIBXL_HAVE_QXL 1
+
+/*
  * LIBXL_HAVE_SPICE_VDAGENT
  *
  * If defined, then the libxl_spice_info structure will contain a boolean type:
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index e5a343f..188f7df 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -248,6 +248,10 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
                 if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                     b_info->video_memkb = 0;
                 break;
+            case LIBXL_VGA_INTERFACE_TYPE_QXL:
+                LOG(ERROR,"qemu upstream required for qxl vga");
+                return ERROR_INVAL;
+                break;
             case LIBXL_VGA_INTERFACE_TYPE_STD:
                 if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                     b_info->video_memkb = 8 * 1024;
@@ -272,6 +276,15 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
                 if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                     b_info->video_memkb = 0;
                 break;
+            case LIBXL_VGA_INTERFACE_TYPE_QXL:
+                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;
+                }
+                break;
             case LIBXL_VGA_INTERFACE_TYPE_STD:
                 if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
                     b_info->video_memkb = 16 * 1024;
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 30c1578..58c9b99 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -251,6 +251,8 @@ static char ** libxl__build_device_model_args_old(libxl__gc *gc,
         case LIBXL_VGA_INTERFACE_TYPE_NONE:
             flexarray_append_pair(dm_args, "-vga", "none");
             break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            break;
         }
 
         if (b_info->u.hvm.boot) {
@@ -625,6 +627,12 @@ static char ** libxl__build_device_model_args_new(libxl__gc *gc,
             break;
         case LIBXL_VGA_INTERFACE_TYPE_NONE:
             break;
+        case LIBXL_VGA_INTERFACE_TYPE_QXL:
+            /* QXL have 2 ram regions, ram and vram */
+            flexarray_append_pair(dm_args, "-device",
+                GCSPRINTF("qxl-vga,vram_size_mb=%"PRIu64",ram_size_mb=%"PRIu64,
+                (b_info->video_memkb/2/1024), (b_info->video_memkb/2/1024) ) );
+            break;
         }
 
         if (b_info->u.hvm.boot) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 117b61d..023b21e 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -183,6 +183,7 @@ libxl_vga_interface_type = Enumeration("vga_interface_type", [
     (1, "CIRRUS"),
     (2, "STD"),
     (3, "NONE"),
+    (4, "QXL"),
     ], init_val = "LIBXL_VGA_INTERFACE_TYPE_CIRRUS")
 
 libxl_vendor_device = Enumeration("vendor_device", [
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 648ca08..526a1f6 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -2115,6 +2115,8 @@ skip_vfb:
                 b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_CIRRUS;
             } else if (!strcmp(buf, "none")) {
                 b_info->u.hvm.vga.kind = LIBXL_VGA_INTERFACE_TYPE_NONE;
+            } 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);
                 exit(1);
-- 
1.9.2
+20 −16
Original line number Diff line number Diff line
@@ -14,30 +14,34 @@ let
    # Sources needed to build the xen tools and tools/firmware.
    toolsGits =
      [ # tag qemu-xen-4.4.1
        { name = "qemu-xen";
        { git = { name = "qemu-xen";
                  url = git://xenbits.xen.org/qemu-upstream-4.4-testing.git;
                  rev = "65fc9b78ba3d868a26952db0d8e51cecf01d47b4";
                  sha256 = "e24fb58f773fd9134c5aae6d3ca7e9f754dc9822de92b1eb2cedc76faf911f18";
                };
        }
        # tag xen-4.4.1
        {  name = "qemu-xen-traditional";
        { git = { name = "qemu-xen-traditional";
                  url = git://xenbits.xen.org/qemu-xen-4.4-testing.git;
                  rev = "6ae4e588081620b141071eb010ec40aca7e12876";
                  sha256 = "b1ed1feb92fbe658273a8d6d38d6ea60b79c1658413dd93979d6d128d8554ded";
                };
        }
      ];

    firmwareGits =
      [ # tag 1.7.3.1
        { name = "seabios";
        { git = { name = "seabios";
                  url = git://xenbits.xen.org/seabios.git;
                  rev = "7d9cbe613694924921ed1a6f8947d711c5832eee";
                  sha256 = "c071282bbcb1dd0d98536ef90cd1410f5d8da19648138e0e3863bc540d954a87";
                };
        }
        { name = "ovmf";
        { git = { name = "ovmf";
                  url = git://xenbits.xen.org/ovmf.git;
                  rev = "447d264115c476142f884af0be287622cd244423";
                  sha256 = "7086f882495a8be1497d881074e8f1005dc283a5e1686aec06c1913c76a6319b";
                };
        }
      ];

Loading