From patchwork Sun Feb 19 23:44:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 142083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D9EF4B6FAA for ; Mon, 20 Feb 2012 10:45:39 +1100 (EST) Received: from localhost ([::1]:32870 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzGRj-0000Na-Ir for incoming@patchwork.ozlabs.org; Sun, 19 Feb 2012 18:45:35 -0500 Received: from eggs.gnu.org ([140.186.70.92]:54008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzGRW-0000NR-RM for qemu-devel@nongnu.org; Sun, 19 Feb 2012 18:45:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzGRS-0000k6-TJ for qemu-devel@nongnu.org; Sun, 19 Feb 2012 18:45:22 -0500 Received: from e34.co.us.ibm.com ([32.97.110.152]:39302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzGRS-0000k0-AS for qemu-devel@nongnu.org; Sun, 19 Feb 2012 18:45:18 -0500 Received: from /spool/local by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 19 Feb 2012 16:45:15 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 19 Feb 2012 16:45:13 -0700 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 542C419D804C for ; Sun, 19 Feb 2012 16:45:08 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q1JNjBMf110070 for ; Sun, 19 Feb 2012 16:45:11 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q1JNjBI3001435 for ; Sun, 19 Feb 2012 16:45:11 -0700 Received: from titi.austin.rr.com (sig-9-65-240-157.mts.ibm.com [9.65.240.157]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q1JNj64c001215; Sun, 19 Feb 2012 16:45:09 -0700 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Sun, 19 Feb 2012 17:44:59 -0600 Message-Id: <1329695104-15174-2-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1329695104-15174-1-git-send-email-aliguori@us.ibm.com> References: <1329695104-15174-1-git-send-email-aliguori@us.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12021923-1780-0000-0000-0000034C4712 X-IBM-ISS-SpamDetectors: X-IBM-ISS-DetailInfo: BY=3.00000247; HX=3.00000182; KW=3.00000007; PH=3.00000001; SC=3.00000001; SDB=6.00115228; UDB=6.00028244; UTC=2012-02-19 23:45:14 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.97.110.152 Cc: Anthony Liguori , Alex Graf Subject: [Qemu-devel] [PATCH 1/6] 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 --- console.c | 14 +++++++++++++- console.h | 6 +++++- qemu-char.c | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/console.c b/console.c index 135394f..d8303af 100644 --- a/console.c +++ b/console.c @@ -1510,7 +1510,7 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds) chr->init(chr); } -int text_console_init(QemuOpts *opts, CharDriverState **_chr) +static int text_console_init(QemuOpts *opts, CharDriverState **_chr) { CharDriverState *chr; TextConsole *s; @@ -1555,6 +1555,18 @@ int text_console_init(QemuOpts *opts, CharDriverState **_chr) return 0; } +static VcHandler *vc_handler = text_console_init; + +int vc_init(QemuOpts *opts, CharDriverState **_chr) +{ + return vc_handler(opts, _chr); +} + +void register_vc_handler(VcHandler *handler) +{ + vc_handler = handler; +} + void text_consoles_set_display(DisplayState *ds) { int i; diff --git a/console.h b/console.h index 6ba0d5d..7225ae6 100644 --- a/console.h +++ b/console.h @@ -356,7 +356,6 @@ void vga_hw_text_update(console_ch_t *chardata); int is_graphic_console(void); int is_fixedsize_console(void); -int text_console_init(QemuOpts *opts, CharDriverState **_chr); void text_consoles_set_display(DisplayState *ds); void console_select(unsigned int index); void console_color_init(DisplayState *ds); @@ -364,6 +363,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 int (VcHandler)(QemuOpts *, CharDriverState **); + +int vc_init(QemuOpts *opts, CharDriverState **_chr); +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 b1d80dd..4680d3c 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2736,7 +2736,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 }, #ifdef _WIN32 { .name = "file", .open = qemu_chr_open_win_file_out }, { .name = "pipe", .open = qemu_chr_open_win_pipe },