diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 7bb00d68f572b36f04deff86e7c3e5c4c2f6c83a..b960c82f87869df17c33a3fc09fc7d46f846ad4d 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -296,11 +296,13 @@ void qxl_spice_reset_cursor(PCIQXLDevice *qxl) trace_qxl_spice_reset_cursor(qxl->id); spice_qxl_reset_cursor(&qxl->ssd.qxl); qemu_mutex_lock(&qxl->track_lock); + qemu_mutex_lock(&qxl->ssd.lock); qxl->guest_cursor = 0; qemu_mutex_unlock(&qxl->track_lock); if (qxl->ssd.cursor) { cursor_unref(qxl->ssd.cursor); } + qemu_mutex_unlock(&qxl->ssd.lock); qxl->ssd.cursor = cursor_builtin_hidden(); } diff --git a/ui/spice-display.c b/ui/spice-display.c index 6eb98a5a5cdb00f0601038c4fe22e0db35e109cf..a254d499355729e537e18312e34da5a13fa02d45 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -462,9 +462,7 @@ void qemu_spice_cursor_refresh_bh(void *opaque) QEMUCursor *c = ssd->cursor; assert(ssd->dcl.con); cursor_ref(c); - qemu_mutex_unlock(&ssd->lock); dpy_cursor_define(ssd->dcl.con, c); - qemu_mutex_lock(&ssd->lock); cursor_unref(c); } @@ -765,7 +763,6 @@ static void display_mouse_define(DisplayChangeListener *dcl, { SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl); - qemu_mutex_lock(&ssd->lock); cursor_ref(c); cursor_unref(ssd->cursor); ssd->cursor = c; @@ -775,7 +772,6 @@ static void display_mouse_define(DisplayChangeListener *dcl, ssd->ptr_move = NULL; g_free(ssd->ptr_define); ssd->ptr_define = qemu_spice_create_cursor_update(ssd, c, 0); - qemu_mutex_unlock(&ssd->lock); qemu_spice_wakeup(ssd); }