qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org,
	Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>,
	Kirill Batuzov <batuzovk@ispras.ru>,
	Anthony Liguori <aliguori@amazon.com>,
	Zifei Tong <zifeitong@gmail.com>
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] qemu-char: Do not disconnect when there's data for reading
Date: Thu, 10 Sep 2015 11:03:25 +0300	[thread overview]
Message-ID: <20150910110257-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <54227845.6090508@msgid.tls.msk.ru>

On Wed, Sep 24, 2014 at 11:52:37AM +0400, Michael Tokarev wrote:
> 16.09.2014 09:31, Zifei Tong wrote:
> > Friendly ping.
> > 
> > Also CC to qemu-trivial.
> 
> There was at least 2 subsequent versions of this down the line,
> a v2 and a v3.  (Just to show why I haven't applied it to -trivial).
> 
> Thanks,
> 
> /mjt

It's also far from trivial.
I don't see why it applies there.

> > On Sun, Sep 7, 2014 at 8:24 PM, Zifei Tong <zifeitong@gmail.com> wrote:
> >> After commit 812c1057f6175ac9a9829fa2920a2b5783814193 (Handle G_IO_HUP
> >> in tcp_chr_read for tcp chardev), the connection is disconnected when in
> >> G_IO_HUP condition.
> >>
> >> However, it's possible that the channel is in G_IO_IN condition at the
> >> same time, meaning there is data for reading. In that case, the
> >> remaining data is not handled.
> >>
> >> I saw a related bug when running socat in write-only mode, with
> >>
> >>   $ echo "quit" | socat -u - UNIX-CONNECT:qemu-monitor
> >>
> >> the monitor won't not run the 'quit' command.
> >>
> >> CC: Kirill Batuzov <batuzovk@ispras.ru>
> >> CC: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
> >> CC: Anthony Liguori <aliguori@amazon.com>
> >> Signed-off-by: Zifei Tong <zifeitong@gmail.com>
> >> ---
> >>  qemu-char.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/qemu-char.c b/qemu-char.c
> >> index 1a8d9aa..5018c3a 100644
> >> --- a/qemu-char.c
> >> +++ b/qemu-char.c
> >> @@ -2706,7 +2706,7 @@ static gboolean tcp_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
> >>      uint8_t buf[READ_BUF_LEN];
> >>      int len, size;
> >>
> >> -    if (cond & G_IO_HUP) {
> >> +    if (!(cond & G_IO_IN) && (cond & G_IO_HUP)) {
> >>          /* connection closed */
> >>          tcp_chr_disconnect(chr);
> >>          return TRUE;
> >> --
> >> 2.1.0
> >>
> > 
> 

  reply	other threads:[~2015-09-10  8:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 12:24 [Qemu-devel] [PATCH] qemu-char: Do not disconnect when there's data for reading Zifei Tong
2014-09-16  5:31 ` Zifei Tong
2014-09-24  7:52   ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2015-09-10  8:03     ` Michael S. Tsirkin [this message]
2014-09-16  6:06 ` [Qemu-devel] " Markus Armbruster
2014-09-16  7:04   ` Zifei Tong
2014-09-16 15:30   ` Kirill Batuzov
2014-09-17 10:44     ` Zifei Tong

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=20150910110257-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=batuzovk@ispras.ru \
    --cc=mjt@tls.msk.ru \
    --cc=n.nikolaev@virtualopensystems.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zifeitong@gmail.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).