From f8dc431e3785af636f4beba592511ad2edf43ecc Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 20 May 2016 16:36:01 -0400 Subject: [PATCH] Explicitly error if spice GL setup fails Fix monitor resizing with virgl (bz #1337564) Fix libvirt noise when introspecting qemu-kvm without hw virt --- ...i-spice-Exit-if-gl-on-EGL-init-fails.patch | 30 +++++++ ...add-use-qemu_spice_gl_monitor_config.patch | 83 +++++++++++++++++++ qemu.spec | 13 ++- 3 files changed, 123 insertions(+), 3 deletions(-) create mode 100644 0004-ui-spice-Exit-if-gl-on-EGL-init-fails.patch create mode 100644 0005-spice-gl-add-use-qemu_spice_gl_monitor_config.patch diff --git a/0004-ui-spice-Exit-if-gl-on-EGL-init-fails.patch b/0004-ui-spice-Exit-if-gl-on-EGL-init-fails.patch new file mode 100644 index 0000000..b51d5b6 --- /dev/null +++ b/0004-ui-spice-Exit-if-gl-on-EGL-init-fails.patch @@ -0,0 +1,30 @@ +From: Cole Robinson +Date: Wed, 18 May 2016 11:44:33 -0400 +Subject: [PATCH] ui: spice: Exit if gl=on EGL init fails + +The user explicitly requested spice GL, so if we know it isn't +going to work we should exit + +Signed-off-by: Cole Robinson +--- + ui/spice-core.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/ui/spice-core.c b/ui/spice-core.c +index 61db3c1..da05054 100644 +--- a/ui/spice-core.c ++++ b/ui/spice-core.c +@@ -833,9 +833,11 @@ void qemu_spice_init(void) + "incompatible with -spice port/tls-port"); + exit(1); + } +- if (egl_rendernode_init() == 0) { +- display_opengl = 1; ++ if (egl_rendernode_init() != 0) { ++ error_report("Failed to initialize EGL render node for SPICE GL"); ++ exit(1); + } ++ display_opengl = 1; + } + #endif + } diff --git a/0005-spice-gl-add-use-qemu_spice_gl_monitor_config.patch b/0005-spice-gl-add-use-qemu_spice_gl_monitor_config.patch new file mode 100644 index 0000000..a7f68c4 --- /dev/null +++ b/0005-spice-gl-add-use-qemu_spice_gl_monitor_config.patch @@ -0,0 +1,83 @@ +From: Gerd Hoffmann +Date: Wed, 3 Feb 2016 13:55:00 +0100 +Subject: [PATCH] spice/gl: add & use qemu_spice_gl_monitor_config +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Cc: qemu-stable@nongnu.org +Signed-off-by: Gerd Hoffmann +Reviewed-by: Marc-André Lureau +(cherry picked from commit 39414ef4e93db9041e463a097084a407d0d374f0) +--- + include/ui/spice-display.h | 1 + + ui/spice-display.c | 30 ++++++++++++++++++++++++++++++ + 2 files changed, 31 insertions(+) + +diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h +index 00e4a0b..3c679e8 100644 +--- a/include/ui/spice-display.h ++++ b/include/ui/spice-display.h +@@ -71,6 +71,7 @@ typedef struct QXLCookie { + QXLRect area; + int redraw; + } render; ++ void *data; + } u; + } QXLCookie; + +diff --git a/ui/spice-display.c b/ui/spice-display.c +index 242ab5f..2a77a54 100644 +--- a/ui/spice-display.c ++++ b/ui/spice-display.c +@@ -660,6 +660,11 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token) + qemu_bh_schedule(ssd->gl_unblock_bh); + break; + } ++ case QXL_COOKIE_TYPE_IO: ++ if (cookie->io == QXL_IO_MONITORS_CONFIG_ASYNC) { ++ g_free(cookie->u.data); ++ } ++ break; + #endif + default: + /* should never be called, used in qxl native mode only */ +@@ -795,6 +800,29 @@ static const DisplayChangeListenerOps display_listener_ops = { + + #ifdef HAVE_SPICE_GL + ++static void qemu_spice_gl_monitor_config(SimpleSpiceDisplay *ssd, ++ int x, int y, int w, int h) ++{ ++ QXLMonitorsConfig *config; ++ QXLCookie *cookie; ++ ++ config = g_malloc0(sizeof(QXLMonitorsConfig) + sizeof(QXLHead)); ++ config->count = 1; ++ config->max_allowed = 1; ++ config->heads[0].x = x; ++ config->heads[0].y = y; ++ config->heads[0].width = w; ++ config->heads[0].height = h; ++ cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO, ++ QXL_IO_MONITORS_CONFIG_ASYNC); ++ cookie->u.data = config; ++ ++ spice_qxl_monitors_config_async(&ssd->qxl, ++ (uintptr_t)config, ++ MEMSLOT_GROUP_HOST, ++ (uintptr_t)cookie); ++} ++ + static void qemu_spice_gl_block(SimpleSpiceDisplay *ssd, bool block) + { + uint64_t timeout; +@@ -858,6 +886,8 @@ static void qemu_spice_gl_scanout(DisplayChangeListener *dcl, + surface_width(ssd->ds), + surface_height(ssd->ds), + stride, fourcc, y_0_top); ++ ++ qemu_spice_gl_monitor_config(ssd, x, y, w, h); + } + + static void qemu_spice_gl_update(DisplayChangeListener *dcl, diff --git a/qemu.spec b/qemu.spec index 1785bbe..54d8069 100644 --- a/qemu.spec +++ b/qemu.spec @@ -49,7 +49,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 2.6.0 -Release: 1%{?rcrel}%{?dist} +Release: 2%{?rcrel}%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -85,11 +85,13 @@ Source21: 50-kvm-s390x.conf # Not for upstream, f24 only Patch0001: 0001-spice-F24-spice-has-backported-gl-support.patch # Fix gtk UI crash when switching to monitor (bz #1333424) -# Not upstream yet Patch0002: 0002-ui-gtk-fix-crash-when-terminal-inner-border-is-NULL.patch # Fix sdl2 UI lockup lockup when switching to monitor -# Not upstream yet Patch0003: 0003-ui-sdl2-Release-grab-before-opening-console-window.patch +# Explicitly error if spice GL setup fails +Patch0004: 0004-ui-spice-Exit-if-gl-on-EGL-init-fails.patch +# Fix monitor resizing with virgl (bz #1337564) +Patch0005: 0005-spice-gl-add-use-qemu_spice_gl_monitor_config.patch # documentation deps @@ -1213,6 +1215,11 @@ getent passwd qemu >/dev/null || \ %changelog +* Fri May 20 2016 Cole Robinson - 2:2.6.0-2 +- Explicitly error if spice GL setup fails +- Fix monitor resizing with virgl (bz #1337564) +- Fix libvirt noise when introspecting qemu-kvm without hw virt + * Fri May 13 2016 Cole Robinson - 2:2.6.0-1 - Rebase to v2.6.0 GA