[Qemu-devel] [PATCH resend v2 1/2] monitor: Reset HMP mon->rs in CHR_EVENT_OPEN

2014-09-15 Thread Stratos Psomadakis
connection too. Due to the fact that monitor reads 1 byte at a time (for each tcp_chr_read()), the monitor readline state / buffers might contain junk (i.e. a half-finished command). Thus, without calling readline_restart() on mon->rs in CHR_EVENT_OPEN, future HMP commands will fail. Signed-of

Re: [Qemu-devel] [synnefo-devel] Re: [PATCH resend 1/2] monitor: Reset HMP mon->rs on CHR_EVENT_CLOSED

2014-09-13 Thread Stratos Psomadakis
On 12/09/2014 08:19 μμ, Luiz Capitulino wrote: > On Fri, 12 Sep 2014 20:01:04 +0300 > Stratos Psomadakis wrote: > >> On 12/09/2014 06:21 μμ, Luiz Capitulino wrote: >>> On Fri, 12 Sep 2014 17:07:32 +0300 >>> Stratos Psomadakis wrote: >>> >>>&

Re: [Qemu-devel] [synnefo-devel] Re: [PATCH resend 1/2] monitor: Reset HMP mon->rs on CHR_EVENT_CLOSED

2014-09-12 Thread Stratos Psomadakis
On 12/09/2014 06:21 μμ, Luiz Capitulino wrote: > On Fri, 12 Sep 2014 17:07:32 +0300 > Stratos Psomadakis wrote: > >> Commit cdaa86a54 ("Add G_IO_HUP handler for socket chardev") exposed a bug in >> the way the HMP monitor handles its command buffer. When a client

[Qemu-devel] [PATCH resend 1/2] monitor: Reset HMP mon->rs on CHR_EVENT_CLOSED

2014-09-12 Thread Stratos Psomadakis
Signed-off-by: Stratos Psomadakis Signed-off-by: Dimitris Aragiorgis --- monitor.c |1 + 1 file changed, 1 insertion(+) diff --git a/monitor.c b/monitor.c index 34cee74..7857300 100644 --- a/monitor.c +++ b/monitor.c @@ -5252,6 +5252,7 @@ static void monitor_event(void *opaque, int event)

Re: [Qemu-devel] [synnefo-devel] Re: [PATCH 1/2] monitor: Reset HMP mon->rs on CHR_EVENT_CLOSED

2014-09-12 Thread Stratos Psomadakis
On 12/09/2014 09:58 πμ, Markus Armbruster wrote: > Stratos Psomadakis writes: > >> Commit cdaa86a54 ("Add G_IO_HUP handler for socket chardev") exposed a >> bug in the way the HMP monitor handles its input. When a client closes >> the connection to the monitor,

Re: [Qemu-devel] [PATCH 2/2] iotests: Send the correct fd in socket_scm_helper

2014-09-12 Thread Stratos Psomadakis
On 12/09/2014 11:31 πμ, Kevin Wolf wrote: > Am 12.09.2014 um 09:04 hat Markus Armbruster geschrieben: >> Stratos Psomadakis writes: >> >>> Make sure to pass the correct fd via SCM_RIGHTS in socket_scm_helper.c >>> (i.e. fd_to_send, not socket-fd). >>

[Qemu-devel] [PATCH 2/2] iotests: Send the correct fd in socket_scm_helper

2014-09-11 Thread Stratos Psomadakis
Make sure to pass the correct fd via SCM_RIGHTS in socket_scm_helper.c (i.e. fd_to_send, not socket-fd). Signed-off-by: Stratos Psomadakis Signed-off-by: Dimitris Aragiorgis --- tests/qemu-iotests/socket_scm_helper.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests

[Qemu-devel] [PATCH 0/2] Monitor-related fixes

2014-09-11 Thread Stratos Psomadakis
Hi, the first patch fixes an issue with HMP monitors, which was exposed with v2.1.0 (commits cdaa86a and 812c10). The second one fixes a typo in a helper C program used in qemu-iotests. We think that they should be cherry-picked for the next stable release. Thanks, Stratos Stratos Psomadakis

[Qemu-devel] [PATCH 1/2] monitor: Reset HMP mon->rs on CHR_EVENT_CLOSED

2014-09-11 Thread Stratos Psomadakis
ll fail. Signed-off-by: Stratos Psomadakis Signed-off-by: Dimitris Aragiorgis --- monitor.c |1 + 1 file changed, 1 insertion(+) diff --git a/monitor.c b/monitor.c index 34cee74..7857300 100644 --- a/monitor.c +++ b/monitor.c @@ -5252,6 +5252,7 @@ static void monitor_event(void *opaque, in

Re: [Qemu-devel] [PATCH] monitor: Cleanup mon->outbuf on write error

2014-01-29 Thread Stratos Psomadakis
On 01/27/2014 12:30 PM, Stratos Psomadakis wrote: > In case monitor_flush() fails to write the contents of mon->outbuf to > the output device, mon->outbuf is not cleaned up properly. Check the > return code of the qemu_chr_fe_write() function and cleanup the outbuf > if it fai

[Qemu-devel] [PATCH] monitor: Cleanup mon->outbuf on write error

2014-01-27 Thread Stratos Psomadakis
014-01/msg02890.html Signed-off-by: Stratos Psomadakis Signed-off-by: Dimitris Aragiorgis --- monitor.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 80456fb..cba56bc 100644 --- a/monitor.c +++ b/monitor.c @@ -288,8 +288,8 @@ void monitor

Re: [Qemu-devel] Possible bug in monitor code

2014-01-24 Thread Stratos Psomadakis
On 01/23/2014 08:28 PM, Luiz Capitulino wrote: > On Thu, 23 Jan 2014 17:33:33 +0200 > Stratos Psomadakis wrote: > >> On 01/23/2014 03:54 PM, Luiz Capitulino wrote: >>> On Thu, 23 Jan 2014 08:44:02 -0500 >>> Luiz Capitulino wrote: >>> >>>> On

Re: [Qemu-devel] Possible bug in monitor code

2014-01-23 Thread Stratos Psomadakis
gt;>> Reply-To: >>> In-Reply-To: <52e0ec4b.7010...@grnet.gr> >>> >>> On Thu, 01/23 12:17, Stratos Psomadakis wrote: >>>> On 01/23/2014 05:07 AM, Fam Zheng wrote: >>>>> On Wed, 01/22 17:53, Stratos Psomadakis wrote: >>>>>>

Re: [Qemu-devel] Possible bug in monitor code

2014-01-23 Thread Stratos Psomadakis
On 01/23/2014 05:07 AM, Fam Zheng wrote: > On Wed, 01/22 17:53, Stratos Psomadakis wrote: >> Hi, >> >> we've encountered a weird issue regarding monitor (qmp and hmp) behavior >> with qemu-1.7 (and qemu-1.5). The following steps will reproduce the issue: >&

[Qemu-devel] Possible bug in monitor code

2014-01-22 Thread Stratos Psomadakis
rc = qemu_chr_fe_write(mon->chr, (const uint8_t *) buf, len); -if (rc == len) { -/* all flushed */ +if ((rc < 0 && errno != EAGAIN) || (rc == len)) { +/* all flushed or error */ QDECREF(mon->outbuf); mon->o