Skip to contentSkip to conversation

qemu: implement qemu_chr_open_pty for stubdoms

PATCH Applied Stefano Stabellini 2 participants 2 messages Jun 17, 2009 – Jun 18, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu: implement qemu_chr_open_pty for stubdoms

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).

---

qemu-char.c +20 -0
index 819b881..7a6a33d 100644
@@ -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)
 {
Applied
#1 lore raw

Stefano Stabellini writes ("[Xen-devel] [PATCH] [UPDATE] qemu: implement qemu_chr_open_pty for stubdoms"):

Quoted 3 lines

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).

Applied, thanks. (This will appear in qemu-xen-unstable staging very shortly; it will appear in qemu-xen-unstable proper when the tests pass or if we push manually.)

Keir has already applied the patch to xen-unstable.

Ian.