All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH 1/5] oslib-posix: add qemu_pipe_non_block
@ 2013-06-04 20:23 ` Alon Levy
  0 siblings, 0 replies; 40+ messages in thread
From: Alon Levy @ 2013-06-04 20:23 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial

Used by the followin patch.

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 include/qemu-common.h |  1 +
 util/oslib-posix.c    | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/include/qemu-common.h b/include/qemu-common.h
index cb82ef3..c24d75c 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -232,6 +232,7 @@ ssize_t qemu_recv_full(int fd, void *buf, size_t count, int flags)
 
 #ifndef _WIN32
 int qemu_pipe(int pipefd[2]);
+int qemu_pipe_non_block(int pipefd[2]);
 #endif
 
 #ifdef _WIN32
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 3dc8b1b..bc2ce2e 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -188,6 +188,25 @@ int qemu_pipe(int pipefd[2])
     return ret;
 }
 
+int qemu_pipe_non_block(int pipefd[2])
+{
+    int ret;
+
+    ret = qemu_pipe(pipefd);
+    if (ret) {
+        return ret;
+    }
+    if (fcntl(card->pipe[0], F_SETFL, O_NONBLOCK) == -1) {
+        return -errno;
+    }
+    if (fcntl(card->pipe[1], F_SETFL, O_NONBLOCK) == -1) {
+        return -errno;
+    }
+    if (fcntl(card->pipe[0], F_SETOWN, getpid()) == -1) {
+        return -errno;
+    }
+}
+
 int qemu_utimens(const char *path, const struct timespec *times)
 {
     struct timeval tv[2], tv_now;
-- 
1.8.2.1



^ permalink raw reply related	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2013-06-12 12:10 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04 20:23 [Qemu-trivial] [PATCH 1/5] oslib-posix: add qemu_pipe_non_block Alon Levy
2013-06-04 20:23 ` [Qemu-devel] " Alon Levy
2013-06-04 20:23 ` [Qemu-trivial] [PATCH 2/5] use qemu_pipe_non_block Alon Levy
2013-06-04 20:23   ` [Qemu-devel] " Alon Levy
2013-06-04 20:47   ` [Qemu-trivial] " Paolo Bonzini
2013-06-04 20:47     ` [Qemu-devel] " Paolo Bonzini
2013-06-04 20:59     ` [Qemu-trivial] " Alon Levy
2013-06-04 20:59       ` Alon Levy
2013-06-04 21:08       ` [Qemu-trivial] " Peter Maydell
2013-06-04 21:08         ` Peter Maydell
2013-06-04 20:50   ` [Qemu-trivial] " Peter Maydell
2013-06-04 20:50     ` Peter Maydell
2013-06-04 20:56     ` [Qemu-trivial] " Alon Levy
2013-06-04 20:56       ` Alon Levy
2013-06-04 20:23 ` [Qemu-trivial] [PATCH 3/5] libcacard/vscclient: fix leakage of socket on error paths Alon Levy
2013-06-04 20:23   ` [Qemu-devel] " Alon Levy
2013-06-04 20:55   ` [Qemu-trivial] " Peter Maydell
2013-06-04 20:55     ` Peter Maydell
2013-06-12 12:09   ` [Qemu-trivial] " Michael Tokarev
2013-06-12 12:09     ` [Qemu-devel] " Michael Tokarev
2013-06-04 20:23 ` [Qemu-trivial] [PATCH 4/5] libcacard/vreader.c: fix possible NULL dereference Alon Levy
2013-06-04 20:23   ` [Qemu-devel] " Alon Levy
2013-06-04 21:06   ` [Qemu-trivial] " Peter Maydell
2013-06-04 21:06     ` Peter Maydell
2013-06-04 20:23 ` [Qemu-trivial] [PATCH 5/5] libcacard/vscclient.c: fix use of uninitialized variable Alon Levy
2013-06-04 20:23   ` [Qemu-devel] " Alon Levy
2013-06-04 21:12   ` [Qemu-trivial] " Peter Maydell
2013-06-04 21:12     ` Peter Maydell
2013-06-04 20:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 1/5] oslib-posix: add qemu_pipe_non_block Peter Maydell
2013-06-04 20:48   ` Peter Maydell
2013-06-04 21:11 ` [Qemu-trivial] " Eric Blake
2013-06-04 21:11   ` Eric Blake
2013-06-04 21:41   ` [Qemu-trivial] " Alon Levy
2013-06-04 21:41     ` Alon Levy
2013-06-05 19:43 ` [Qemu-trivial] " Michael Tokarev
2013-06-05 19:43   ` [Qemu-devel] " Michael Tokarev
2013-06-12  9:38 ` Michael Tokarev
2013-06-12  9:38   ` [Qemu-devel] " Michael Tokarev
2013-06-12 11:21   ` [Qemu-trivial] [Qemu-devel] " Alon Levy
2013-06-12 11:21     ` [Qemu-devel] [Qemu-trivial] " Alon Levy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.