qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-char: Fixed the bug lead to dead lock


From: Luiz Capitulino
Subject: Re: [Qemu-devel] [PATCH] qemu-char: Fixed the bug lead to dead lock
Date: Mon, 14 Jul 2014 13:56:06 -0400

On Fri, 11 Jul 2014 11:07:15 +0200
Markus Armbruster <address@hidden> wrote:

> Cc'ing folks involved in the flawed commit.
> 
> Liliang <address@hidden> writes:
> 
> > From: Li Liang <address@hidden>
> >
> > 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 <address@hidden>
> 
> Long lines in commit message, and the subject isn't as informative as it
> could be.  Suggest something like:
> 
>     qemu-char: Fix deadlock in pty character device
> 
>     To reproduce, run with "-monitor pty", then try to read from the
>     slave /dev/pts/FOO created for it.
> 
>     Broken in commit 9005b2a.

Paolo posted a pull request today with a fix for this issue included:

[PULL 2/5] qemu-char: fix deadlock with "-monitor pty"

Thanks Paolo!

> 
> > ---
> >  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;
> >  }
> 




reply via email to

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