Re: [Qemu-devel] [PATCH] char: kick main loop after adding a watch

2017-04-03 Thread Stefan Hajnoczi
On Fri, Mar 31, 2017 at 06:53:56PM +0200, Paolo Bonzini wrote: > > > On 31/03/2017 18:43, Stefan Hajnoczi wrote: > > The ISA serial port device's output can hang when the pipe on stdout > > becomes full. This is a race condition where the vcpu thread executing > > serial emulation code adds a wa

Re: [Qemu-devel] [PATCH] char: kick main loop after adding a watch

2017-04-01 Thread Paolo Bonzini
On 31/03/2017 19:31, Richard W.M. Jones wrote: > On Fri, Mar 31, 2017 at 06:53:56PM +0200, Paolo Bonzini wrote: >> glib is expecting QEMU to use g_main_context_acquire around accesses to >> GMainContext. However QEMU is not doing that, instead it is taking its >> own mutex. So we should add g

Re: [Qemu-devel] [PATCH] char: kick main loop after adding a watch

2017-03-31 Thread Richard W.M. Jones
On Fri, Mar 31, 2017 at 07:31:57PM +0200, Paolo Bonzini wrote: > > > On 31/03/2017 19:31, Richard W.M. Jones wrote: > > On Fri, Mar 31, 2017 at 06:53:56PM +0200, Paolo Bonzini wrote: > >> glib is expecting QEMU to use g_main_context_acquire around accesses to > >> GMainContext. However QEMU is

Re: [Qemu-devel] [PATCH] char: kick main loop after adding a watch

2017-03-31 Thread Paolo Bonzini
On 31/03/2017 19:31, Richard W.M. Jones wrote: > On Fri, Mar 31, 2017 at 06:53:56PM +0200, Paolo Bonzini wrote: >> glib is expecting QEMU to use g_main_context_acquire around accesses to >> GMainContext. However QEMU is not doing that, instead it is taking its >> own mutex. So we should add g

Re: [Qemu-devel] [PATCH] char: kick main loop after adding a watch

2017-03-31 Thread Richard W.M. Jones
On Fri, Mar 31, 2017 at 06:53:56PM +0200, Paolo Bonzini wrote: > glib is expecting QEMU to use g_main_context_acquire around accesses to > GMainContext. However QEMU is not doing that, instead it is taking its > own mutex. So we should add g_main_context_acquire and > g_main_context_release in

Re: [Qemu-devel] [PATCH] char: kick main loop after adding a watch

2017-03-31 Thread Richard W.M. Jones
On Fri, Mar 31, 2017 at 05:43:22PM +0100, Stefan Hajnoczi wrote: > The ISA serial port device's output can hang when the pipe on stdout > becomes full. This is a race condition where the vcpu thread executing > serial emulation code adds a watch on stdout while the main loop thread > is blocked in

Re: [Qemu-devel] [PATCH] char: kick main loop after adding a watch

2017-03-31 Thread Paolo Bonzini
On 31/03/2017 18:43, Stefan Hajnoczi wrote: > The ISA serial port device's output can hang when the pipe on stdout > becomes full. This is a race condition where the vcpu thread executing > serial emulation code adds a watch on stdout while the main loop thread > is blocked in ppoll(2). If no t

[Qemu-devel] [PATCH] char: kick main loop after adding a watch

2017-03-31 Thread Stefan Hajnoczi
The ISA serial port device's output can hang when the pipe on stdout becomes full. This is a race condition where the vcpu thread executing serial emulation code adds a watch on stdout while the main loop thread is blocked in ppoll(2). If no timer or other event wakes up the main loop, there will