All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH 4 of 5] qemu: implement qemu_chr_open_pty for stubdoms
Date: Thu, 11 Jun 2009 16:08:01 +0100	[thread overview]
Message-ID: <4A311DD1.5020100@eu.citrix.com> (raw)

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

                 reply	other threads:[~2009-06-11 15:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A311DD1.5020100@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.