qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 6/8] qxl: locking fixes


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH 6/8] qxl: locking fixes
Date: Thu, 27 Jan 2011 11:12:28 +0100

Two spice worker calls lack the unlock/relock calls,
which may lead to deadlocks, add them.

[ v2: add unlock/lock to one more place, found by Alon Levy ]

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 hw/qxl.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/qxl.c b/hw/qxl.c
index dcea65d..ac3e87e 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -770,7 +770,9 @@ static void qxl_add_memslot(PCIQXLDevice *d, uint32_t 
slot_id, uint64_t delta)
            __FUNCTION__, memslot.slot_id,
            memslot.virt_start, memslot.virt_end);
 
+    qemu_mutex_unlock_iothread();
     d->ssd.worker->add_memslot(d->ssd.worker, &memslot);
+    qemu_mutex_lock_iothread();
     d->guest_slots[slot_id].ptr = (void*)memslot.virt_start;
     d->guest_slots[slot_id].size = memslot.virt_end - memslot.virt_start;
     d->guest_slots[slot_id].delta = delta;
@@ -866,7 +868,9 @@ static void qxl_destroy_primary(PCIQXLDevice *d)
     dprint(d, 1, "%s\n", __FUNCTION__);
 
     d->mode = QXL_MODE_UNDEFINED;
+    qemu_mutex_unlock_iothread();
     d->ssd.worker->destroy_primary_surface(d->ssd.worker, 0);
+    qemu_mutex_lock_iothread();
 }
 
 static void qxl_set_mode(PCIQXLDevice *d, int modenr, int loadvm)
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]