All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4 of 5] qemu: implement qemu_chr_open_pty for stubdoms
@ 2009-06-11 15:08 Stefano Stabellini
  0 siblings, 0 replies; only message in thread
From: Stefano Stabellini @ 2009-06-11 15:08 UTC (permalink / raw)
  To: xen-devel

This patchs implements qemu_chr_open_pty for stubdoms.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

---

diff --git a/qemu-char.c b/qemu-char.c
index 819b881..177abb9 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1120,6 +1120,26 @@ static CharDriverState *qemu_chr_open_tty(const char *filename)
     qemu_chr_reset(chr);
     return chr;
 }
+#elif CONFIG_STUBDOM
+#include <lib.h>
+static CharDriverState *qemu_chr_open_pty(void)
+{
+    CharDriverState *chr;
+    int fd;
+
+    fd = openpty();
+    if (fd < 0)
+        return NULL;
+
+    chr = qemu_chr_open_fd(fd, fd);
+    if (!chr) {
+        close(fd);
+        return NULL;
+    }
+
+    qemu_chr_reset(chr);
+    return chr;
+}
 #else  /* ! __linux__ && ! __sun__ */
 static CharDriverState *qemu_chr_open_pty(void)
 {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-06-11 15:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-11 15:08 [PATCH 4 of 5] qemu: implement qemu_chr_open_pty for stubdoms Stefano Stabellini

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.