From mboxrd@z Thu Jan 1 00:00:00 1970 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 From: Gerd Hoffmann 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> Subject: [Qemu-devel] [PATCH 11/19] chardev: add console support to qapi List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Gerd Hoffmann 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 -- 1.7.9.7