Skip to contentSkip to conversation

hw/qxl: another missing unlock

PATCH In review Alon Levy 2 participants 2 messages Jan 25, 2011 – Jan 27, 2011

lore
Share & tools
lore

Alon Levy

author
#0 lore raw

PATCH 1/1 hw/qxl: another missing unlock

We need to unlock the mutex before waiting on read via the worker call since the worker will try to lock and hang otherwise.

---
 hw/qxl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/qxl.c +2 -0
index 117f7c8..00c31c7 100644
@@ -791,7 +791,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);
 
+    qxl_unlock_iothread(&d->ssd);
     d->ssd.worker->add_memslot(d->ssd.worker, &memslot);
+    qxl_lock_iothread(&d->ssd);
     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;
Signature · 1 line
1.7.3.5
#1 lore raw
Quoted 14 lines · Alon Levy

We need to unlock the mutex before waiting on read via the worker call since the worker will try to lock and hang otherwise.

---
  hw/qxl.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
hw/qxl.c +0 -0
index 117f7c8..00c31c7 100644

hw/qxl.c static void qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta) · line 799

Quoted 9 lines
hw/qxl.c +2 -0
@@ -791,7 +791,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);
 
+    qxl_unlock_iothread(&d->ssd);
      d->ssd.worker->add_memslot(d->ssd.worker,&memslot);
+    qxl_lock_iothread(&d->ssd);
      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;

added to spice patch queue

thanks,
Gerd