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