summary refs log tree commit diff stats
path: root/hw/display/qxl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-03-06 09:31:51 +0100
committerGerd Hoffmann <kraxel@redhat.com>2017-03-09 09:47:26 +0100
commitdbb5fb8d3519130559b10fa4e1395e4486c633f8 (patch)
treef9ae033e00a0da826d1f789e220a3ce83774f864 /hw/display/qxl.c
parentab6b1105a2259c7072905887f71caa850ce63190 (diff)
downloadfocaccia-qemu-dbb5fb8d3519130559b10fa4e1395e4486c633f8.tar.gz
focaccia-qemu-dbb5fb8d3519130559b10fa4e1395e4486c633f8.zip
qxl: clear guest_cursor on QXL_CURSOR_HIDE
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>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 1488789111-27340-1-git-send-email-kraxel@redhat.com
Diffstat (limited to 'hw/display/qxl.c')
-rw-r--r--hw/display/qxl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index af4c0ca002..0d02f0efe6 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;
     }
     }