From patchwork Tue Mar 12 08:56:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 226844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4E06D2C0291 for ; Tue, 12 Mar 2013 20:06:43 +1100 (EST) Received: from localhost ([::1]:60365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFLAP-0007nK-1n for incoming@patchwork.ozlabs.org; Tue, 12 Mar 2013 05:06:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFLA5-0007nA-RT for qemu-devel@nongnu.org; Tue, 12 Mar 2013 05:06:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFL0b-0003zS-Ub for qemu-devel@nongnu.org; Tue, 12 Mar 2013 04:56:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27517) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFL0b-0003yj-Jp for qemu-devel@nongnu.org; Tue, 12 Mar 2013 04:56:33 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2C8uW2U026071 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 12 Mar 2013 04:56:33 -0400 Received: from rincewind.home.kraxel.org (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2C8uVnd005631; Tue, 12 Mar 2013 04:56:32 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 35B8B41524; Tue, 12 Mar 2013 09:56:30 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 12 Mar 2013 09:56:21 +0100 Message-Id: <1363078589-15233-12-git-send-email-kraxel@redhat.com> In-Reply-To: <1363078589-15233-1-git-send-email-kraxel@redhat.com> References: <1363078589-15233-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Anthony Liguori , Gerd Hoffmann Subject: [Qemu-devel] [PATCH 11/19] chardev: add console support to qapi X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds 'console' support to qapi and also switches over the console chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qapi-schema.json | 3 ++- qemu-char.c | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/qapi-schema.json b/qapi-schema.json index 77d4153..94a3f02 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -3226,7 +3226,8 @@ 'mux' : 'ChardevMux', 'msmouse': 'ChardevDummy', 'braille': 'ChardevDummy', - 'stdio' : 'ChardevStdio' } } + 'stdio' : 'ChardevStdio', + 'console': 'ChardevDummy' } } ## # @ChardevReturn: diff --git a/qemu-char.c b/qemu-char.c index 6be38b0..4f0fdce 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -1928,7 +1928,7 @@ static CharDriverState *qemu_chr_open_win_file(HANDLE fd_out) return chr; } -static CharDriverState *qemu_chr_open_win_con(QemuOpts *opts) +static CharDriverState *qemu_chr_open_win_con(void) { return qemu_chr_open_win_file(GetStdHandle(STD_OUTPUT_HANDLE)); } @@ -3684,6 +3684,11 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend, case CHARDEV_BACKEND_KIND_STDIO: chr = qemu_chr_open_stdio(backend->stdio); break; +#ifdef _WIN32 + case CHARDEV_BACKEND_KIND_CONSOLE: + chr = qemu_chr_open_win_con(); + break; +#endif default: error_setg(errp, "unknown chardev backend (%d)", backend->kind); break; @@ -3740,9 +3745,9 @@ static void register_types(void) register_char_driver_qapi("parport", CHARDEV_BACKEND_KIND_PARALLEL, qemu_chr_parse_parallel); register_char_driver_qapi("pty", CHARDEV_BACKEND_KIND_PTY, NULL); + register_char_driver_qapi("console", CHARDEV_BACKEND_KIND_CONSOLE, NULL); #ifdef _WIN32 register_char_driver("pipe", qemu_chr_open_win_pipe); - register_char_driver("console", qemu_chr_open_win_con); #else register_char_driver("pipe", qemu_chr_open_pipe); #endif