From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: [PATCH 4 of 5] qemu: implement qemu_chr_open_pty for stubdoms Date: Thu, 11 Jun 2009 16:08:01 +0100 Message-ID: <4A311DD1.5020100@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org This patchs implements qemu_chr_open_pty for stubdoms. Signed-off-by: Stefano Stabellini --- 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 +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) {