qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_open_fd.
Date: Tue, 22 Jul 2008 20:26:59 -0500	[thread overview]
Message-ID: <488688E3.105@codemonkey.ws> (raw)
In-Reply-To: <E1KJqa3-00067A-KN@mariner.uk.xensource.com>

Hi,

Ian Jackson wrote:
> The rest of qemu assumes that IO operations on a CharDriverState do
> not block.  Currently there are a couple of cases where such a driver
> was set up but the calls to set nonblocking mode were missing:
>  * qemu_chr_open_pty
>  * qemu_chr_open_pipe
>  * qemu_chr_open_stdio
>
> This is fixed by adding two calls to socket_set_nonblock to
> qemu_chr_open_fd.
>   

This changes semantics a bit.  Previously, using a pty would guarantee 
that data is always written as qemu_chr_write does not perform any sort 
of buffering.

Now, that data will be silently dropped instead of causing QEMU to 
block.  I don't think it's perfectly clear that one behaviour is clearly 
better than the other.

Regards,

Anthony Liguori

> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> ---
>  vl.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 4f31288..c428c7e 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -2090,6 +2090,9 @@ static CharDriverState *qemu_chr_open_fd(int fd_in, int fd_out)
>      CharDriverState *chr;
>      FDCharDriver *s;
>  
> +    socket_set_nonblock(fd_in);
> +    socket_set_nonblock(fd_out);
> +
>      chr = qemu_mallocz(sizeof(CharDriverState));
>      if (!chr)
>          return NULL;
>   

  reply	other threads:[~2008-07-23  1:27 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-18 13:24 [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_open_fd Ian Jackson
2008-07-23  1:26 ` Anthony Liguori [this message]
2008-07-23  8:24   ` Daniel P. Berrange
2008-07-23 11:48     ` Gerd Hoffmann
2008-07-23 12:15       ` Daniel P. Berrange
2008-07-23 12:52         ` Gerd Hoffmann
2008-07-23 12:59           ` Daniel P. Berrange
2008-07-23 14:24           ` Gerd Hoffmann
2008-07-23 15:24             ` Anthony Liguori
2008-07-23 15:31               ` Daniel P. Berrange
2008-07-23 15:32                 ` Anthony Liguori
2008-07-23 16:17                   ` Gerd Hoffmann
2008-07-23 16:33                     ` Anthony Liguori
2008-07-23 19:08                       ` Jamie Lokier
2008-07-24  7:24                         ` Gerd Hoffmann
2008-07-24  7:54                       ` Gerd Hoffmann
2008-07-24  8:31                         ` Daniel P. Berrange
2008-07-24  9:24                         ` Jamie Lokier
2008-07-24  9:33                           ` Samuel Thibault
2008-07-24 11:18                             ` Gerd Hoffmann
2008-07-23 16:11               ` Gerd Hoffmann
2008-07-23 16:31                 ` Anthony Liguori
2008-07-24  8:35                   ` Daniel P. Berrange
2008-07-24 14:23                     ` Anthony Liguori
2008-07-24 15:07                       ` Jamie Lokier
2008-07-24 14:53                         ` Gerd Hoffmann
2008-07-23 16:44                 ` Paul Brook
2008-07-24 17:37                   ` Anthony Liguori
2008-07-25  7:15                   ` Gerd Hoffmann
2008-07-25 16:17                     ` Jamie Lokier
2008-07-28  8:49                       ` Gerd Hoffmann
2008-07-28 11:59                         ` Jamie Lokier
2008-07-28 12:20                           ` Gerd Hoffmann
2017-02-01 12:33                             ` David Woodhouse
2008-07-24 15:37             ` [Qemu-devel] " Anthony Liguori
2008-07-25 11:42               ` Gerd Hoffmann
2008-07-25 15:04                 ` Anthony Liguori
2008-07-28  9:59                   ` Gerd Hoffmann
2008-07-28 18:55                     ` Anthony Liguori
2008-07-23  9:34   ` [Qemu-devel] " Kevin Wolf
2008-07-23 10:17     ` Ian Jackson
2008-07-23 11:43       ` Kevin Wolf
2008-07-23 12:04     ` Gerd Hoffmann
2008-07-23 12:18       ` Paul Brook

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=488688E3.105@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /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).