All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-char: Fixed the bug lead to dead lock
@ 2014-07-11  4:58 Liliang
  2014-07-11  9:07 ` Markus Armbruster
  2014-07-11  9:07 ` Peter Maydell
  0 siblings, 2 replies; 5+ messages in thread
From: Liliang @ 2014-07-11  4:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: Li Liang, aliguori

From: Li Liang <liangx.z.li@intel.com>

This bug was introduced in the commit 9005b2a7589540a3733b3abdcfbccfe7746cd1a1,
it will cause deadlock when create a vm with the parameter "-monitor pty" and
then try to read from /dev/pts/x.

Signed-off-by: Li Liang <liangx.z.li@intel.com>
---
 qemu-char.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qemu-char.c b/qemu-char.c
index 55e372c..55cdded 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1103,9 +1103,11 @@ static gboolean pty_chr_timer(gpointer opaque)
     s->timer_tag = 0;
     if (!s->connected) {
         /* Next poll ... */
+        qemu_mutex_unlock(&chr->chr_write_lock);
         pty_chr_update_read_handler_locked(chr);
+    } else {
+        qemu_mutex_unlock(&chr->chr_write_lock);
     }
-    qemu_mutex_unlock(&chr->chr_write_lock);
     return FALSE;
 }
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-14 17:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11  4:58 [Qemu-devel] [PATCH] qemu-char: Fixed the bug lead to dead lock Liliang
2014-07-11  9:07 ` Markus Armbruster
2014-07-14 17:56   ` Luiz Capitulino
2014-07-11  9:07 ` Peter Maydell
2014-07-11  9:30   ` Li, LiangX Z

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.