yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
ae23c9
From f44bd8a3bc71029a53cc06e848787cd867390b47 Mon Sep 17 00:00:00 2001
ae23c9
From: Gerd Hoffmann <kraxel@redhat.com>
ae23c9
Date: Wed, 13 Jun 2018 13:15:57 +0200
ae23c9
Subject: [PATCH 063/268] qxl: fix local renderer crash
ae23c9
MIME-Version: 1.0
ae23c9
Content-Type: text/plain; charset=UTF-8
ae23c9
Content-Transfer-Encoding: 8bit
ae23c9
ae23c9
RH-Author: Gerd Hoffmann <kraxel@redhat.com>
ae23c9
Message-id: <20180613131557.12255-2-kraxel@redhat.com>
ae23c9
Patchwork-id: 80662
ae23c9
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 1/1] qxl: fix local renderer crash
ae23c9
Bugzilla: 1567733
ae23c9
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ae23c9
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
ae23c9
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
ae23c9
ae23c9
Make sure we only ask the spice local renderer for display updates in
ae23c9
case we have a valid primary surface.  Without that spice is confused
ae23c9
and throws errors in case a display update request (triggered by
ae23c9
screendump for example) happens in parallel to a mode switch and hits
ae23c9
the race window where the old primary surface is gone and the new isn't
ae23c9
establisted yet.
ae23c9
ae23c9
Cc: qemu-stable@nongnu.org
ae23c9
Fixes: https://bugzilla.redhat.com//show_bug.cgi?id=1567733
ae23c9
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ae23c9
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
ae23c9
Message-id: 20180427115528.345-1-kraxel@redhat.com
ae23c9
(cherry picked from commit 5bd5c27c7d284d01477c5cc022ce22438c46bf9f)
ae23c9
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ae23c9
---
ae23c9
 hw/display/qxl-render.c | 3 ++-
ae23c9
 1 file changed, 2 insertions(+), 1 deletion(-)
ae23c9
ae23c9
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
ae23c9
index e7ac4f8..c62b9a5 100644
ae23c9
--- a/hw/display/qxl-render.c
ae23c9
+++ b/hw/display/qxl-render.c
ae23c9
@@ -169,7 +169,8 @@ void qxl_render_update(PCIQXLDevice *qxl)
ae23c9
 
ae23c9
     qemu_mutex_lock(&qxl->ssd.lock);
ae23c9
 
ae23c9
-    if (!runstate_is_running() || !qxl->guest_primary.commands) {
ae23c9
+    if (!runstate_is_running() || !qxl->guest_primary.commands ||
ae23c9
+        qxl->mode == QXL_MODE_UNDEFINED) {
ae23c9
         qxl_render_update_area_unlocked(qxl);
ae23c9
         qemu_mutex_unlock(&qxl->ssd.lock);
ae23c9
         return;
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9