Skip to contentSkip to conversation

qemu-char: initialize out_lock

PATCH Applied Paolo Bonzini 3 participants 3 messages Jun 25, 2014 – Jun 26, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-char: initialize out_lock

Otherwise, Windows fails with a deadlock.

---
 qemu-char.c | 1 +
 1 file changed, 1 insertion(+)
qemu-char.c +1 -0
index 2e50a10..17bd360 100644
@@ -94,6 +94,7 @@ static QTAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs =
 CharDriverState *qemu_chr_alloc(void)
 {
     CharDriverState *chr = g_malloc0(sizeof(CharDriverState));
+    qemu_mutex_init(&chr->chr_write_lock);
     return chr;
 }
 
Signature · 1 line
1.9.3
Tested-by on v1 1/1
#1 lore raw

Am 25.06.2014 09:04, schrieb Paolo Bonzini:

Quoted 13 lines

Otherwise, Windows fails with a deadlock.

---
 qemu-char.c | 1 +
 1 file changed, 1 insertion(+)
qemu-char.c +0 -0
index 2e50a10..17bd360 100644

qemu-char.c static QTAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs = · line 100

Quoted 7 lines
qemu-char.c +1 -0
@@ -94,6 +94,7 @@ static QTAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs =
 CharDriverState *qemu_chr_alloc(void)
 {
     CharDriverState *chr = g_malloc0(sizeof(CharDriverState));
+    qemu_mutex_init(&chr->chr_write_lock);
     return chr;
 }
 

Thanks, this fixes the problem with QEMU for Windows.