Skip to contentSkip to conversation

qxl: clear guest_cursor on QXL_CURSOR_HIDE

PATCH In review Gerd Hoffmann 2 participants 2 messages Mar 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 hw/display/qxl.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/display/qxl.c +5 -0
index af4c0ca..0d02f0e 100644
@@ -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;
     }
     }
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · 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

Quoted 21 lines
---
 hw/display/qxl.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/display/qxl.c +5 -0
index af4c0ca..0d02f0e 100644
@@ -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;
     }
     }
Quoted 5 lines

--
1.8.3.1

--

Marc-André Lureau