From patchwork Tue Dec 8 12:11:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0EE60B7B5F for ; Tue, 8 Dec 2009 23:30:07 +1100 (EST) Received: from localhost ([127.0.0.1]:46770 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHzCc-0004UJ-90 for incoming@patchwork.ozlabs.org; Tue, 08 Dec 2009 07:30:02 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHyvN-0005gU-09 for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:12:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHyvH-0005e0-OA for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:12:12 -0500 Received: from [199.232.76.173] (port=44195 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHyvH-0005dr-4A for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:12:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7882) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHyvG-00082T-M3 for qemu-devel@nongnu.org; Tue, 08 Dec 2009 07:12:06 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB8CC5fn000659 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Dec 2009 07:12:06 -0500 Received: from zweiblum.home.kraxel.org (vpn2-9-91.ams2.redhat.com [10.36.9.91]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB8CC2kB031069; Tue, 8 Dec 2009 07:12:03 -0500 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 09D407010D; Tue, 8 Dec 2009 13:11:57 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 8 Dec 2009 13:11:39 +0100 Message-Id: <1260274314-2906-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1260274314-2906-1-git-send-email-kraxel@redhat.com> References: <1260274314-2906-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann , agraf@suse.de, lcapitulino@redhat.com Subject: [Qemu-devel] [FOR 0.12 PATCH v4 07/22] chardev: move greeting into vc backend. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Make the 'vc' chardev backend print a title line with the chardev name after initialization, using CharDriverState->label. This replaces the banner printing code in vl.c. Signed-off-by: Gerd Hoffmann --- console.c | 8 ++++++++ vl.c | 24 ------------------------ 2 files changed, 8 insertions(+), 24 deletions(-) diff --git a/console.c b/console.c index 82ddbe4..2aeb5b3 100644 --- a/console.c +++ b/console.c @@ -1384,6 +1384,14 @@ static void text_console_do_init(CharDriverState *chr, DisplayState *ds, QemuOpt s->t_attrib = s->t_attrib_default; text_console_resize(s); + if (chr->label) { + char msg[128]; + int len; + + len = snprintf(msg, sizeof(msg), "%s console\r\n", chr->label); + console_puts(chr, (uint8_t*)msg, len); + } + qemu_chr_generic_open(chr); if (chr->init) chr->init(chr); diff --git a/vl.c b/vl.c index 172828a..333780f 100644 --- a/vl.c +++ b/vl.c @@ -5866,30 +5866,6 @@ int main(int argc, char **argv, char **envp) } } - for(i = 0; i < MAX_SERIAL_PORTS; i++) { - const char *devname = serial_devices[i]; - if (devname && strcmp(devname, "none")) { - if (strstart(devname, "vc", 0)) - qemu_chr_printf(serial_hds[i], "serial%d console\r\n", i); - } - } - - for(i = 0; i < MAX_PARALLEL_PORTS; i++) { - const char *devname = parallel_devices[i]; - if (devname && strcmp(devname, "none")) { - if (strstart(devname, "vc", 0)) - qemu_chr_printf(parallel_hds[i], "parallel%d console\r\n", i); - } - } - - for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) { - const char *devname = virtio_consoles[i]; - if (virtcon_hds[i] && devname) { - if (strstart(devname, "vc", 0)) - qemu_chr_printf(virtcon_hds[i], "virtio console%d\r\n", i); - } - } - if (gdbstub_dev && gdbserver_start(gdbstub_dev) < 0) { fprintf(stderr, "qemu: could not open gdbserver on device '%s'\n", gdbstub_dev);