Re: [Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex

2014-06-10 Thread Luiz Capitulino
On Tue, 10 Jun 2014 16:24:29 +0200 Paolo Bonzini wrote: > Il 10/06/2014 16:10, Luiz Capitulino ha scritto: > >> > +qemu_mutex_lock(&hmp.out_lock); > >> > if (qstring_get_length(hmp.outbuf) > 0) { > >> > output = g_strdup(qstring_get_str(hmp.outbuf)); > >> > } else { > >> >

Re: [Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex

2014-06-10 Thread Paolo Bonzini
Il 10/06/2014 16:10, Luiz Capitulino ha scritto: > +qemu_mutex_lock(&hmp.out_lock); > if (qstring_get_length(hmp.outbuf) > 0) { > output = g_strdup(qstring_get_str(hmp.outbuf)); > } else { > output = g_strdup(""); > } > +qemu_mutex_unlock(&hmp.out_lock);

Re: [Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex

2014-06-10 Thread Luiz Capitulino
On Tue, 3 Jun 2014 18:39:10 +0200 Paolo Bonzini wrote: > This lets the block layer emit QMP events from outside the I/O thread. To be honest I'm starting to forget monitor code, but this looks correct to me. I have only one comment below that doesn't prevent me from adding: Reviewed-by: Luiz C

[Qemu-devel] [PATCH 5/6] monitor: protect outbuf with mutex

2014-06-03 Thread Paolo Bonzini
This lets the block layer emit QMP events from outside the I/O thread. Signed-off-by: Paolo Bonzini --- monitor.c | 35 --- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/monitor.c b/monitor.c index 342e83b..ebc66fb 100644 --- a/monitor.c +++ b/mon