peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0424-qxl-init_pipe_signaling-exit-on-failure.patch

56753f
From d3e6c37f68e7e4573a47b0540f626a2add0d05e4 Mon Sep 17 00:00:00 2001
56753f
From: Alon Levy <alevy@redhat.com>
56753f
Date: Sun, 18 Mar 2012 13:46:13 +0100
56753f
Subject: [PATCH 424/434] qxl: init_pipe_signaling: exit on failure
56753f
56753f
If pipe creation fails, exit, don't log and continue. Fix indentation at
56753f
the same time.
56753f
56753f
Signed-off-by: Alon Levy <alevy@redhat.com>
56753f
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
56753f
---
56753f
 hw/qxl.c |   21 +++++++++++----------
56753f
 1 file changed, 11 insertions(+), 10 deletions(-)
56753f
56753f
diff --git a/hw/qxl.c b/hw/qxl.c
56753f
index 73be115..9ad5807 100644
56753f
--- a/hw/qxl.c
56753f
+++ b/hw/qxl.c
56753f
@@ -1453,16 +1453,17 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events)
56753f
 
56753f
 static void init_pipe_signaling(PCIQXLDevice *d)
56753f
 {
56753f
-   if (pipe(d->pipe) < 0) {
56753f
-       dprint(d, 1, "%s: pipe creation failed\n", __FUNCTION__);
56753f
-       return;
56753f
-   }
56753f
-   fcntl(d->pipe[0], F_SETFL, O_NONBLOCK);
56753f
-   fcntl(d->pipe[1], F_SETFL, O_NONBLOCK);
56753f
-   fcntl(d->pipe[0], F_SETOWN, getpid());
56753f
-
56753f
-   qemu_thread_get_self(&d->main);
56753f
-   qemu_set_fd_handler(d->pipe[0], pipe_read, NULL, d);
56753f
+    if (pipe(d->pipe) < 0) {
56753f
+        fprintf(stderr, "%s:%s: qxl pipe creation failed\n",
56753f
+                __FILE__, __func__);
56753f
+        exit(1);
56753f
+    }
56753f
+    fcntl(d->pipe[0], F_SETFL, O_NONBLOCK);
56753f
+    fcntl(d->pipe[1], F_SETFL, O_NONBLOCK);
56753f
+    fcntl(d->pipe[0], F_SETOWN, getpid());
56753f
+
56753f
+    qemu_thread_get_self(&d->main);
56753f
+    qemu_set_fd_handler(d->pipe[0], pipe_read, NULL, d);
56753f
 }
56753f
 
56753f
 /* graphics console */
56753f
-- 
56753f
1.7.10
56753f