From patchwork Thu Jan 21 10:49:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 43425 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 0C9B1B7CB9 for ; Thu, 21 Jan 2010 21:51:28 +1100 (EST) Received: from localhost ([127.0.0.1]:48111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXudJ-0003oS-2t for incoming@patchwork.ozlabs.org; Thu, 21 Jan 2010 05:51:25 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXucV-0003nm-5S for qemu-devel@nongnu.org; Thu, 21 Jan 2010 05:50:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXucQ-0003ln-7K for qemu-devel@nongnu.org; Thu, 21 Jan 2010 05:50:34 -0500 Received: from [199.232.76.173] (port=35451 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXucP-0003lk-UZ for qemu-devel@nongnu.org; Thu, 21 Jan 2010 05:50:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54575) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXucP-0002E6-CI for qemu-devel@nongnu.org; Thu, 21 Jan 2010 05:50:29 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0LAoRO3015210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 21 Jan 2010 05:50:28 -0500 Received: from localhost (dhcp1-127.pnq.redhat.com [10.65.193.127]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0LAoPLc029463; Thu, 21 Jan 2010 05:50:26 -0500 From: Amit Shah To: qemu-devel@nongnu.org Date: Thu, 21 Jan 2010 16:19:23 +0530 Message-Id: <1264070963-1722-1-git-send-email-amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Amit Shah Subject: [Qemu-devel] [PATCH] virtio-console: Automatically use virtio-serial-bus for the older -virtioconsole invocation 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 These hunks got dropped off mysteriously during the rebasing of my virtio-serial series. Thanks go to Markus for noticing it. Without these fixes, -virtioconsole doesn't actually have any effect. Signed-off-by: Amit Shah Reported-by: Markus Armbruster --- roms/seabios | 2 +- vl.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/roms/seabios b/roms/seabios index 5da6833..8362699 160000 --- a/roms/seabios +++ b/roms/seabios @@ -1 +1 @@ -Subproject commit 5da68339ecf44677b8f4f115cdf3cb1da46a9f6c +Subproject commit 8362699269d7b3c816981be0e306d7531aa3ea1d diff --git a/vl.c b/vl.c index e070ec9..ae3ee0b 100644 --- a/vl.c +++ b/vl.c @@ -288,8 +288,9 @@ static struct { { .driver = "isa-parallel", .flag = &default_parallel }, { .driver = "isa-fdc", .flag = &default_floppy }, { .driver = "ide-drive", .flag = &default_cdrom }, - { .driver = "virtio-console-pci", .flag = &default_virtcon }, - { .driver = "virtio-console-s390", .flag = &default_virtcon }, + { .driver = "virtio-serial-pci", .flag = &default_virtcon }, + { .driver = "virtio-serial-s390", .flag = &default_virtcon }, + { .driver = "virtio-serial", .flag = &default_virtcon }, { .driver = "VGA", .flag = &default_vga }, { .driver = "cirrus-vga", .flag = &default_vga }, { .driver = "vmware-svga", .flag = &default_vga }, @@ -4623,6 +4624,7 @@ static int virtcon_parse(const char *devname) { static int index = 0; char label[32]; + QemuOpts *bus_opts, *dev_opts; if (strcmp(devname, "none") == 0) return 0; @@ -4630,6 +4632,13 @@ static int virtcon_parse(const char *devname) fprintf(stderr, "qemu: too many virtio consoles\n"); exit(1); } + + bus_opts = qemu_opts_create(&qemu_device_opts, NULL, 0); + qemu_opt_set(bus_opts, "driver", "virtio-serial"); + + dev_opts = qemu_opts_create(&qemu_device_opts, NULL, 0); + qemu_opt_set(dev_opts, "driver", "virtconsole"); + snprintf(label, sizeof(label), "virtcon%d", index); virtcon_hds[index] = qemu_chr_open(label, devname, NULL); if (!virtcon_hds[index]) { @@ -4637,6 +4646,8 @@ static int virtcon_parse(const char *devname) devname, strerror(errno)); return -1; } + qemu_opt_set(dev_opts, "chardev", label); + index++; return 0; }