From patchwork Wed Feb 20 13:43:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 222094 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 C681C2C007A for ; Thu, 21 Feb 2013 01:51:55 +1100 (EST) Received: from localhost ([::1]:60605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U89yK-0001XH-KK for incoming@patchwork.ozlabs.org; Wed, 20 Feb 2013 08:44:32 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U89xf-0008Vk-GR for qemu-devel@nongnu.org; Wed, 20 Feb 2013 08:43:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U89xe-0005Th-98 for qemu-devel@nongnu.org; Wed, 20 Feb 2013 08:43:51 -0500 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:41494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U89xd-0005T9-Nm for qemu-devel@nongnu.org; Wed, 20 Feb 2013 08:43:50 -0500 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 20 Feb 2013 19:10:37 +0530 Received: from d28dlp03.in.ibm.com (9.184.220.128) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 20 Feb 2013 19:10:26 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id 962011258051 for ; Wed, 20 Feb 2013 19:14:22 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1KDhXmd29753364 for ; Wed, 20 Feb 2013 19:13:33 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1KDhZ6T013794 for ; Thu, 21 Feb 2013 00:43:35 +1100 Received: from titi.austin.rr.com (sig-9-76-138-226.mts.ibm.com [9.76.138.226]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r1KDhSxt013442; Thu, 21 Feb 2013 00:43:33 +1100 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Wed, 20 Feb 2013 07:43:19 -0600 Message-Id: <1361367806-4599-3-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1361367806-4599-1-git-send-email-aliguori@us.ibm.com> References: <1361367806-4599-1-git-send-email-aliguori@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13022013-5816-0000-0000-000006C1DC1B X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 122.248.162.2 Cc: Kevin Wolf , Anthony Liguori Subject: [Qemu-devel] [PATCH 2/9] console: allow VCs to be overridden by UI 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 We want to expose VCs using a VteTerminal widget. We need access to provide our own CharDriverState in order to do this. Signed-off-by: Anthony Liguori --- include/ui/console.h | 6 +++++- qemu-char.c | 2 +- ui/console.c | 14 +++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index fc23baa..b907931 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -442,7 +442,6 @@ void vga_hw_text_update(console_ch_t *chardata); int is_graphic_console(void); int is_fixedsize_console(void); -CharDriverState *text_console_init(QemuOpts *opts); void text_consoles_set_display(DisplayState *ds); void console_select(unsigned int index); void console_color_init(DisplayState *ds); @@ -450,6 +449,11 @@ void qemu_console_resize(DisplayState *ds, int width, int height); void qemu_console_copy(DisplayState *ds, int src_x, int src_y, int dst_x, int dst_y, int w, int h); +typedef CharDriverState *(VcHandler)(QemuOpts *); + +CharDriverState *vc_init(QemuOpts *opts); +void register_vc_handler(VcHandler *handler); + /* sdl.c */ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame); diff --git a/qemu-char.c b/qemu-char.c index e4b0f53..160decc 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2980,7 +2980,7 @@ static const struct { { .name = "socket", .open = qemu_chr_open_socket }, { .name = "udp", .open = qemu_chr_open_udp }, { .name = "msmouse", .open = qemu_chr_open_msmouse }, - { .name = "vc", .open = text_console_init }, + { .name = "vc", .open = vc_init }, { .name = "memory", .open = qemu_chr_open_ringbuf }, #ifdef _WIN32 { .name = "file", .open = qemu_chr_open_win_file_out }, diff --git a/ui/console.c b/ui/console.c index 0a68836..163706e 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1532,7 +1532,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds) chr->init(chr); } -CharDriverState *text_console_init(QemuOpts *opts) +static CharDriverState *text_console_init(QemuOpts *opts) { CharDriverState *chr; QemuConsole *s; @@ -1568,6 +1568,18 @@ CharDriverState *text_console_init(QemuOpts *opts) return chr; } +static VcHandler *vc_handler = text_console_init; + +CharDriverState *vc_init(QemuOpts *opts) +{ + return vc_handler(opts); +} + +void register_vc_handler(VcHandler *handler) +{ + vc_handler = handler; +} + void text_consoles_set_display(DisplayState *ds) { int i;