From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/3] loop write in qemu_event_increment upon EINTR
Date: Tue, 2 Feb 2010 20:33:10 +0100 [thread overview]
Message-ID: <1265139191-13568-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1265139191-13568-1-git-send-email-pbonzini@redhat.com>
Same as what qemu-kvm does.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
vl.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index 46c1118..f150eca 100644
--- a/vl.c
+++ b/vl.c
@@ -3198,8 +3198,12 @@ static void qemu_event_increment(void)
if (io_thread_fd == -1)
return;
- ret = write(io_thread_fd, &byte, sizeof(byte));
- if (ret < 0 && (errno != EINTR && errno != EAGAIN)) {
+ do {
+ ret = write(io_thread_fd, &byte, sizeof(byte));
+ } while (ret < 0 && errno == EINTR);
+
+ /* EAGAIN is fine, a read must be pending. */
+ if (ret < 0 && errno != EAGAIN) {
fprintf(stderr, "qemu_event_increment: write() filed: %s\n",
strerror(errno));
exit (1);
--
1.6.6
next prev parent reply other threads:[~2010-02-02 19:33 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
2010-02-02 19:33 ` Paolo Bonzini [this message]
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=1265139191-13568-3-git-send-email-pbonzini@redhat.com \
--to=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 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).