lol
1From 296c7f3284efe655d95a8ae045a5dc1a20d6fff0 Mon Sep 17 00:00:00 2001
2From: Fabio Fantoni <fabio.fantoni@m2r.biz>
3Date: Tue, 20 Jan 2015 11:33:17 +0100
4Subject: [PATCH] libxl: Spice streaming video setting support for upstream
5 qemu
6
7Usage:
8spice_streaming_video=[filter|all|off]
9
10Specifies what streaming video setting is to be used by spice (if
11given),
12otherwise the qemu default will be used.
13
14Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
15Acked-by: Wei Liu <wei.liu2@citrix.com>
16---
17 docs/man/xl.cfg.pod.5 | 5 +++++
18 tools/libxl/libxl.h | 11 +++++++++++
19 tools/libxl/libxl_dm.c | 4 ++++
20 tools/libxl/libxl_types.idl | 1 +
21 tools/libxl/xl_cmdimpl.c | 2 ++
22 5 files changed, 23 insertions(+)
23
24diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
25index 0c2cbac..408653f 100644
26--- a/docs/man/xl.cfg.pod.5
27+++ b/docs/man/xl.cfg.pod.5
28@@ -1433,6 +1433,11 @@ Specifies what image compression is to be used by spice (if given), otherwise
29 the qemu default will be used. Please see documentations of your current qemu
30 version for details.
31
32+=item B<spice_streaming_video=[filter|all|off]>
33+
34+Specifies what streaming video setting is to be used by spice (if given),
35+otherwise the qemu default will be used.
36+
37 =back
38
39 =head3 Miscellaneous Emulated Hardware
40diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
41index b8e0b67..c219f59 100644
42--- a/tools/libxl/libxl.h
43+++ b/tools/libxl/libxl.h
44@@ -539,6 +539,17 @@ typedef struct libxl__ctx libxl_ctx;
45 #define LIBXL_HAVE_SPICE_IMAGECOMPRESSION 1
46
47 /*
48+ * LIBXL_HAVE_SPICE_STREAMINGVIDEO
49+ *
50+ * If defined, then the libxl_spice_info structure will contain a string type
51+ * field: streaming_video. This value defines what Spice streaming video setting
52+ * is used.
53+ *
54+ * If this is not defined, the Spice streaming video setting support is ignored.
55+ */
56+#define LIBXL_HAVE_SPICE_STREAMINGVIDEO 1
57+
58+/*
59 * LIBXL_HAVE_DOMAIN_CREATE_RESTORE_PARAMS 1
60 *
61 * If this is defined, libxl_domain_create_restore()'s API has changed to
62diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
63index 40c8649..d8d6f0c 100644
64--- a/tools/libxl/libxl_dm.c
65+++ b/tools/libxl/libxl_dm.c
66@@ -402,6 +402,10 @@ static char *dm_spice_options(libxl__gc *gc,
67 opt = libxl__sprintf(gc, "%s,image-compression=%s", opt,
68 spice->image_compression);
69
70+ if (spice->streaming_video)
71+ opt = libxl__sprintf(gc, "%s,streaming-video=%s", opt,
72+ spice->streaming_video);
73+
74 return opt;
75 }
76
77diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
78index 052ded9..02be466 100644
79--- a/tools/libxl/libxl_types.idl
80+++ b/tools/libxl/libxl_types.idl
81@@ -242,6 +242,7 @@ libxl_spice_info = Struct("spice_info", [
82 ("clipboard_sharing", libxl_defbool),
83 ("usbredirection", integer),
84 ("image_compression", string),
85+ ("streaming_video", string),
86 ])
87
88 libxl_sdl_info = Struct("sdl_info", [
89diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
90index 00aa69d..b7eac29 100644
91--- a/tools/libxl/xl_cmdimpl.c
92+++ b/tools/libxl/xl_cmdimpl.c
93@@ -1950,6 +1950,8 @@ skip_vfb:
94 b_info->u.hvm.spice.usbredirection = l;
95 xlu_cfg_replace_string (config, "spice_image_compression",
96 &b_info->u.hvm.spice.image_compression, 0);
97+ xlu_cfg_replace_string (config, "spice_streaming_video",
98+ &b_info->u.hvm.spice.streaming_video, 0);
99 xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
100 xlu_cfg_get_defbool(config, "gfx_passthru",
101 &b_info->u.hvm.gfx_passthru, 0);
102--
1031.9.2
104