summaryrefslogtreecommitdiffstats
path: root/vl.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2010-02-02 20:33:09 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-10 11:56:56 -0600
commit1d0f0d91f298cbda1990edc92cf8ac306c474cdf (patch)
tree8f2164481bb49d62012099e0e33e0df087e2b162 /vl.c
parent889ae39c9adad4fbfc1da56c40c78f035f3da32d (diff)
downloadhqemu-1d0f0d91f298cbda1990edc92cf8ac306c474cdf.zip
hqemu-1d0f0d91f298cbda1990edc92cf8ac306c474cdf.tar.gz
do not loop on an incomplete io_thread_fd read
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> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index b87044c..f98661f 100644
--- a/vl.c
+++ b/vl.c
@@ -3229,12 +3229,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)
OpenPOWER on IntegriCloud