qemu-char: initialize chr_write_lock
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 Jun 2014 07:04:57 +0000 (09:04 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 26 Jun 2014 12:13:54 +0000 (13:13 +0100)
Otherwise, Windows fails with a deadlock.

Reported-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1403679897-11480-1-git-send-email-pbonzini@redhat.com
Tested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
qemu-char.c

index f6bdf2fae4b734038c4c767f94da0d07a6b1d4ef..cbd6b9a025b61480dad5b28d56ce91828a0cc690 100644 (file)
@@ -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;
 }