WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] [UPDATE] qemu: implement qemu_chr_open_pty for stubd

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] [UPDATE] qemu: implement qemu_chr_open_pty for stubdoms
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Wed, 17 Jun 2009 13:45:31 +0100
Delivery-date: Wed, 17 Jun 2009 05:42:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080505)
Hi all,
this is an updated version of the patch "implement qemu_chr_open_pty for
stubdoms": qemu_chr_open_pty is now based on posix_openpt instead of
openpty(void).

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>

---

diff --git a/qemu-char.c b/qemu-char.c
index 819b881..7a6a33d 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 <fcntl.h>
+static CharDriverState *qemu_chr_open_pty(void)
+{
+    CharDriverState *chr;
+    int fd;
+
+    fd = posix_openpt(O_RDWR|O_NOCTTY);
+    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)
 {

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>