5124efbe-add-qxl-support.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=351
This commit is contained in:
Charles Arnold 2015-03-16 23:29:59 +00:00 committed by Git OBS Bridge
parent e2823d1bba
commit 54fee29628
6 changed files with 174 additions and 12 deletions

View File

@ -0,0 +1,159 @@
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@xxxxxxx>
Signed-off-by: Zhou Peng <zpengxen@xxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
---
Changes in v16:
- refresh
- improved commit description
Changes in v15:
- refresh
- small code improvements in libxl_dm.c
Changes in v14:
- refresh
- update qemu parameters (from -vga to -device)
NOTES:
Works correctly with windows domUs, tested on windows 7 64 bit
with qxl driver from spice guest tools 0.74.
I tested some resolution not supported by stdvga (1366x768, 1600x900
and 1920x1080) with 32 bit color and all works good equal to kvm.
For now not works on linux domUs when xorg have 100% cpu and black
screen with qxl driver installed.
Seems needed other changes/fixes on xen and/or xorg/qxl driver side
before have it full working with linux domUs.
---
docs/man/xl.cfg.pod.5 | 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 ++
5 files changed, 33 insertions(+), 1 deletion(-)
Index: xen-4.5.0-testing/docs/man/xl.cfg.pod.5
===================================================================
--- xen-4.5.0-testing.orig/docs/man/xl.cfg.pod.5
+++ xen-4.5.0-testing/docs/man/xl.cfg.pod.5
@@ -1292,6 +1292,9 @@ qemu-xen-traditional device-model, the a
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
@@ -1303,9 +1306,14 @@ This option is deprecated, use vga="stdv
=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
Index: xen-4.5.0-testing/tools/libxl/libxl_create.c
===================================================================
--- xen-4.5.0-testing.orig/tools/libxl/libxl_create.c
+++ xen-4.5.0-testing/tools/libxl/libxl_create.c
@@ -240,6 +240,10 @@ int libxl__domain_build_info_setdefault(
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;
@@ -264,6 +268,15 @@ int libxl__domain_build_info_setdefault(
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;
Index: xen-4.5.0-testing/tools/libxl/libxl_dm.c
===================================================================
--- xen-4.5.0-testing.orig/tools/libxl/libxl_dm.c
+++ xen-4.5.0-testing/tools/libxl/libxl_dm.c
@@ -244,6 +244,8 @@ static char ** libxl__build_device_model
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) {
@@ -590,6 +592,12 @@ static char ** libxl__build_device_model
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) {
Index: xen-4.5.0-testing/tools/libxl/libxl_types.idl
===================================================================
--- xen-4.5.0-testing.orig/tools/libxl/libxl_types.idl
+++ xen-4.5.0-testing/tools/libxl/libxl_types.idl
@@ -181,6 +181,7 @@ libxl_vga_interface_type = Enumeration("
(1, "CIRRUS"),
(2, "STD"),
(3, "NONE"),
+ (4, "QXL"),
], init_val = "LIBXL_VGA_INTERFACE_TYPE_CIRRUS")
libxl_vendor_device = Enumeration("vendor_device", [
Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
===================================================================
--- xen-4.5.0-testing.orig/tools/libxl/xl_cmdimpl.c
+++ xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
@@ -1910,6 +1910,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);

View File

@ -503,7 +503,7 @@ Index: xen-4.5.0-testing/tools/libxl/libxl_create.c
===================================================================
--- xen-4.5.0-testing.orig/tools/libxl/libxl_create.c
+++ xen-4.5.0-testing/tools/libxl/libxl_create.c
@@ -1128,6 +1128,7 @@ static void domcreate_rebuild_done(libxl
@@ -1141,6 +1141,7 @@ static void domcreate_rebuild_done(libxl
libxl__multidev_begin(ao, &dcs->multidev);
dcs->multidev.callback = domcreate_launch_dm;
libxl__add_disks(egc, ao, domid, d_config, &dcs->multidev);
@ -594,7 +594,7 @@ Index: xen-4.5.0-testing/tools/libxl/libxl_types.idl
===================================================================
--- xen-4.5.0-testing.orig/tools/libxl/libxl_types.idl
+++ xen-4.5.0-testing/tools/libxl/libxl_types.idl
@@ -539,6 +539,26 @@ libxl_device_channel = Struct("device_ch
@@ -540,6 +540,26 @@ libxl_device_channel = Struct("device_ch
])),
])
@ -621,7 +621,7 @@ Index: xen-4.5.0-testing/tools/libxl/libxl_types.idl
libxl_domain_config = Struct("domain_config", [
("c_info", libxl_domain_create_info),
("b_info", libxl_domain_build_info),
@@ -552,6 +572,8 @@ libxl_domain_config = Struct("domain_con
@@ -553,6 +573,8 @@ libxl_domain_config = Struct("domain_con
# a channel manifests as a console with a name,
# see docs/misc/channels.txt
("channels", Array(libxl_device_channel, "num_channels")),
@ -630,7 +630,7 @@ Index: xen-4.5.0-testing/tools/libxl/libxl_types.idl
("on_poweroff", libxl_action_on_shutdown),
("on_reboot", libxl_action_on_shutdown),
@@ -594,6 +616,28 @@ libxl_vtpminfo = Struct("vtpminfo", [
@@ -595,6 +617,28 @@ libxl_vtpminfo = Struct("vtpminfo", [
("uuid", libxl_uuid),
], dir=DIR_OUT)
@ -904,7 +904,7 @@ Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
if (!xlu_cfg_get_list(config, "vtpm", &vtpms, 0, 0)) {
d_config->num_vtpms = 0;
d_config->vtpms = NULL;
@@ -6490,6 +6668,256 @@ int main_blockdetach(int argc, char **ar
@@ -6492,6 +6670,256 @@ int main_blockdetach(int argc, char **ar
return rc;
}

View File

@ -387,7 +387,7 @@ Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
===================================================================
--- xen-4.5.0-testing.orig/tools/libxl/xl_cmdimpl.c
+++ xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
@@ -3878,6 +3878,8 @@ static void migrate_do_preamble(int send
@@ -3880,6 +3880,8 @@ static void migrate_do_preamble(int send
}
static void migrate_domain(uint32_t domid, const char *rune, int debug,
@ -396,7 +396,7 @@ Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
const char *override_config_file)
{
pid_t child = -1;
@@ -3886,7 +3888,13 @@ static void migrate_domain(uint32_t domi
@@ -3888,7 +3890,13 @@ static void migrate_domain(uint32_t domi
char *away_domname;
char rc_buf;
uint8_t *config_data;
@ -411,7 +411,7 @@ Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
save_domain_core_begin(domid, override_config_file,
&config_data, &config_len);
@@ -3905,10 +3913,13 @@ static void migrate_domain(uint32_t domi
@@ -3907,10 +3915,13 @@ static void migrate_domain(uint32_t domi
xtl_stdiostream_adjust_flags(logger, XTL_STDIOSTREAM_HIDE_PROGRESS, 0);
if (debug)
@ -428,7 +428,7 @@ Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
" (rc=%d)\n", rc);
if (rc == ERROR_GUEST_TIMEDOUT)
goto failed_suspend;
@@ -4295,13 +4306,18 @@ int main_migrate(int argc, char **argv)
@@ -4297,13 +4308,18 @@ int main_migrate(int argc, char **argv)
char *rune = NULL;
char *host;
int opt, daemonize = 1, monitor = 1, debug = 0;
@ -448,7 +448,7 @@ Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
case 'C':
config_filename = optarg;
break;
@@ -4318,6 +4334,18 @@ int main_migrate(int argc, char **argv)
@@ -4320,6 +4336,18 @@ int main_migrate(int argc, char **argv)
case 0x100:
debug = 1;
break;
@ -467,7 +467,7 @@ Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
}
domid = find_domain(argv[optind]);
@@ -4348,7 +4376,8 @@ int main_migrate(int argc, char **argv)
@@ -4350,7 +4378,8 @@ int main_migrate(int argc, char **argv)
return 1;
}

View File

@ -2,6 +2,7 @@
Mon Mar 16 10:14:15 MDT 2015 - carnold@suse.com
- Enable spice support in qemu for x86_64
5124efbe-add-qxl-support.patch
-------------------------------------------------------------------
Wed Mar 11 13:15:07 MDT 2015 - carnold@suse.com

View File

@ -198,6 +198,7 @@ Source99: baselibs.conf
# http://xenbits.xensource.com/ext/xenalyze
Source20000: xenalyze.hg.tar.bz2
# Upstream patches
Patch1: 5124efbe-add-qxl-support.patch
# Upstream qemu
Patch250: VNC-Support-for-ExtendedKeyEvent-client-message.patch
Patch251: 0001-net-move-the-tap-buffer-into-TAPState.patch
@ -494,6 +495,7 @@ Authors:
%prep
%setup -q -n %xen_build_dir -a 1 -a 2 -a 3 -a 4 -a 5 -a 57 -a 20000
# Upstream patches
%patch1 -p1
# Upstream qemu patches
%patch250 -p1
%patch251 -p1

View File

@ -10,7 +10,7 @@ Index: xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
===================================================================
--- xen-4.5.0-testing.orig/tools/libxl/xl_cmdimpl.c
+++ xen-4.5.0-testing/tools/libxl/xl_cmdimpl.c
@@ -2092,7 +2092,7 @@ static int handle_domain_death(uint32_t
@@ -2094,7 +2094,7 @@ static int handle_domain_death(uint32_t
char *corefile;
int rc;