From: Anthony Liguori <anthony@codemonkey.ws>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] do not loop on an incomplete io_thread_fd read
Date: Wed, 10 Feb 2010 12:32:24 -0600 [thread overview]
Message-ID: <4B72FBB8.80800@codemonkey.ws> (raw)
In-Reply-To: <1265139191-13568-2-git-send-email-pbonzini@redhat.com>
On 02/02/2010 01:33 PM, Paolo Bonzini wrote:
> No need to loop if less than a full buffer is read, the next
> read would return EAGAIN.
>
> Signed-off-by: Paolo Bonzini<pbonzini@redhat.com>
>
Applied all. Thanks.
Regards,
Anthony Liguori
> ---
> vl.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 6f1e1ab..46c1118 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3210,12 +3210,12 @@ static void qemu_event_read(void *opaque)
> {
> int fd = (unsigned long)opaque;
> ssize_t len;
> + char buffer[512];
>
> /* Drain the notify pipe */
> do {
> - char buffer[512];
> len = read(fd, buffer, sizeof(buffer));
> - } while ((len == -1&& errno == EINTR) || len> 0);
> + } while ((len == -1&& errno == EINTR) || len == sizeof(buffer));
> }
>
> static int qemu_event_init(void)
>
next prev parent reply other threads:[~2010-02-10 18:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-02 19:33 [Qemu-devel] [PATCH 0/3] Event signaling tweaks Paolo Bonzini
2010-02-02 19:33 ` [Qemu-devel] [PATCH 1/3] do not loop on an incomplete io_thread_fd read Paolo Bonzini
2010-02-10 18:32 ` Anthony Liguori [this message]
2010-02-02 19:33 ` [Qemu-devel] [PATCH 2/3] loop write in qemu_event_increment upon EINTR Paolo Bonzini
2010-02-02 19:33 ` [Qemu-devel] [PATCH 3/3] fix placement of config-host.h inclusion Paolo Bonzini
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=4B72FBB8.80800@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=pbonzini@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.