Patchwork [PATCHv3] async thread fix - handle EAGAIN/EINTR, remove fprintf

login
register
mail settings
Submitter Alon Levy
Date June 29, 2011, 11:57 a.m.
Message ID <1309348641-20061-3-git-send-email-alevy@redhat.com>
Download mbox | patch
Permalink /patch/102573/
State New
Headers show

Comments

Alon Levy - June 29, 2011, 11:57 a.m.
---
 hw/qxl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/qxl.c b/hw/qxl.c
index 89e452e..3f84b0c 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1025,13 +1025,15 @@  static void *ioport_write_async(void *arg)
 
     while (true) {
         ret = read(d->aio_pipe[0], &io, sizeof(io));
+        if (ret < 0 && (errno == EAGAIN || errno == EINTR)) {
+            continue;
+        }
         if (ret != sizeof(io)) {
             break;
         }
         io_port = io->port;
         val = io->val;
 
-        fprintf(stderr, "%s: 0x%x\n", __FUNCTION__, io_port);
         switch (io_port) {
         case QXL_IO_UPDATE_AREA_ASYNC:
             qxl_spice_update_area(d, io->update_surface,