From patchwork Tue Feb 7 14:09:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 139966 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 EA7A8B7219 for ; Wed, 8 Feb 2012 03:16:11 +1100 (EST) Received: from localhost ([::1]:33794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rulkc-0002dY-EC for incoming@patchwork.ozlabs.org; Tue, 07 Feb 2012 09:10:30 -0500 Received: from eggs.gnu.org ([140.186.70.92]:53860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljl-0001Uk-9H for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ruljg-0005gF-3F for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:37 -0500 Received: from oxygen.pond.sub.org ([78.46.104.156]:39195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ruljf-0005fY-Ps for qemu-devel@nongnu.org; Tue, 07 Feb 2012 09:09:31 -0500 Received: from blackfin.pond.sub.org (p5B32D218.dip.t-dialin.net [91.50.210.24]) by oxygen.pond.sub.org (Postfix) with ESMTPA id F030FA43F9; Tue, 7 Feb 2012 15:09:30 +0100 (CET) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 89B876008E; Tue, 7 Feb 2012 15:09:27 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 7 Feb 2012 15:09:21 +0100 Message-Id: <1328623766-12287-15-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.6.5 In-Reply-To: <1328623766-12287-1-git-send-email-armbru@redhat.com> References: <1328623766-12287-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 78.46.104.156 Cc: kwolf@redhat.com, aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 14/19] console: Eliminate text_consoles[] 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 Simply use consoles[] instead. Signed-off-by: Markus Armbruster --- console.c | 18 ++++-------------- 1 files changed, 4 insertions(+), 14 deletions(-) diff --git a/console.c b/console.c index 2c432e3..744ef2d 100644 --- a/console.c +++ b/console.c @@ -1441,9 +1441,6 @@ void console_color_init(DisplayState *ds) } } -static int n_text_consoles; -static CharDriverState *text_consoles[128]; - static void text_console_set_echo(CharDriverState *chr, bool echo) { TextConsole *s = chr->opaque; @@ -1519,13 +1516,6 @@ CharDriverState *text_console_init(QemuOpts *opts) chr = g_malloc0(sizeof(CharDriverState)); - if (n_text_consoles == 128) { - fprintf(stderr, "Too many text consoles\n"); - exit(1); - } - text_consoles[n_text_consoles] = chr; - n_text_consoles++; - width = qemu_opt_get_number(opts, "width", 0); if (width == 0) width = qemu_opt_get_number(opts, "cols", 0) * FONT_WIDTH; @@ -1557,11 +1547,11 @@ void text_consoles_set_display(DisplayState *ds) { int i; - for (i = 0; i < n_text_consoles; i++) { - text_console_do_init(text_consoles[i], ds); + for (i = 0; i < nb_consoles; i++) { + if (consoles[i]->console_type != GRAPHIC_CONSOLE) { + text_console_do_init(consoles[i]->chr, ds); + } } - - n_text_consoles = 0; } void qemu_console_resize(DisplayState *ds, int width, int height)