qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qxl: clear guest_cursor on QXL_CURSOR_HIDE
@ 2017-03-06  8:31 Gerd Hoffmann
  2017-03-06 10:34 ` Marc-André Lureau
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2017-03-06  8:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Make sure we don't leave guest_cursor pointing into nowhere.  This might
lead to (rare) live migration failures, due to target trying to restore
the cursor from the stale pointer.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1421788
Reported-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/qxl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index af4c0ca..0d02f0e 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -477,6 +477,11 @@ static int qxl_track_command(PCIQXLDevice *qxl, struct QXLCommandExt *ext)
             qxl->guest_cursor = ext->cmd.data;
             qemu_mutex_unlock(&qxl->track_lock);
         }
+        if (cmd->type == QXL_CURSOR_HIDE) {
+            qemu_mutex_lock(&qxl->track_lock);
+            qxl->guest_cursor = 0;
+            qemu_mutex_unlock(&qxl->track_lock);
+        }
         break;
     }
     }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-06 10:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-06  8:31 [Qemu-devel] [PATCH] qxl: clear guest_cursor on QXL_CURSOR_HIDE Gerd Hoffmann
2017-03-06 10:34 ` Marc-André Lureau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).