Re: [Qemu-devel] [PATCH 4/6] qemu-char: make writes thread-safe

2014-06-11 Thread Paolo Bonzini
Il 11/06/2014 08:59, Fam Zheng ha scritto: On Tue, 06/03 18:39, Paolo Bonzini wrote: diff --git a/qemu-char.c b/qemu-char.c index b478a3d..dcd0765 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -121,7 +121,12 @@ void qemu_chr_be_generic_open(CharDriverState *s) int qemu_chr_fe_write(CharDriverS

Re: [Qemu-devel] [PATCH 4/6] qemu-char: make writes thread-safe

2014-06-11 Thread Fam Zheng
On Tue, 06/03 18:39, Paolo Bonzini wrote: > diff --git a/qemu-char.c b/qemu-char.c > index b478a3d..dcd0765 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -121,7 +121,12 @@ void qemu_chr_be_generic_open(CharDriverState *s) > > int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, in

[Qemu-devel] [PATCH 4/6] qemu-char: make writes thread-safe

2014-06-03 Thread Paolo Bonzini
This will let threads other than the I/O thread raise QMP events. GIOChannel is thread-safe, and send and receive state is usually well-separated. The only driver that requires some care is the pty driver, where some of the state is shared by the read and write sides. That state is protected wit