From: Luiz Capitulino <lcapitulino@redhat.com>
To: Stratos Psomadakis <psomas@grnet.gr>
Cc: synnefo-devel@googlegroups.com, ganeti-devel@googlegroups.com,
qemu-devel@nongnu.org, dimara@grnet.gr
Subject: Re: [Qemu-devel] [PATCH] monitor: Cleanup mon->outbuf on write error
Date: Wed, 29 Jan 2014 09:12:44 -0500 [thread overview]
Message-ID: <20140129091244.0af6afda@redhat.com> (raw)
In-Reply-To: <52E8DBEC.1040508@grnet.gr>
On Wed, 29 Jan 2014 12:46:04 +0200
Stratos Psomadakis <psomas@grnet.gr> wrote:
> 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 fails.
> >
> > References: http://lists.nongnu.org/archive/html/qemu-devel/2014-01/msg02890.html
> >
> > Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
> > Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
> > ---
> > 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_flush(Monitor *mon)
> >
> > if (len && !mon->mux_out) {
> > 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->outbuf = qstring_new();
> > return;
>
> Forgot to cc the maintainer.
I included it in my pull request:
http://lists.nongnu.org/archive/html/qemu-devel/2014-01/msg03859.html
But it seems that I forgot to reply to the patch too.
prev parent reply other threads:[~2014-01-29 14:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-22 15:53 [Qemu-devel] Possible bug in monitor code Stratos Psomadakis
2014-01-23 3:07 ` Fam Zheng
2014-01-23 10:17 ` Stratos Psomadakis
2014-01-24 23:48 ` Luiz Capitulino
2014-01-27 10:30 ` [Qemu-devel] [PATCH] monitor: Cleanup mon->outbuf on write error Stratos Psomadakis
2014-01-29 10:46 ` Stratos Psomadakis
2014-01-29 14:12 ` Luiz Capitulino [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140129091244.0af6afda@redhat.com \
--to=lcapitulino@redhat.com \
--cc=dimara@grnet.gr \
--cc=ganeti-devel@googlegroups.com \
--cc=psomas@grnet.gr \
--cc=qemu-devel@nongnu.org \
--cc=synnefo-devel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).