From patchwork Thu Dec 17 12:06:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 41307 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 CF047B6F2B for ; Thu, 17 Dec 2009 23:07:13 +1100 (EST) Received: from localhost ([127.0.0.1]:34291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLF8P-0006ny-34 for incoming@patchwork.ozlabs.org; Thu, 17 Dec 2009 07:07:09 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NLF7a-0006Yy-5i for qemu-devel@nongnu.org; Thu, 17 Dec 2009 07:06:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NLF7U-0006SR-Au for qemu-devel@nongnu.org; Thu, 17 Dec 2009 07:06:16 -0500 Received: from [199.232.76.173] (port=34397 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NLF7U-0006SA-5c for qemu-devel@nongnu.org; Thu, 17 Dec 2009 07:06:12 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41010 helo=mx2.suse.de) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NLF7S-0004yn-Tl for qemu-devel@nongnu.org; Thu, 17 Dec 2009 07:06:11 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id D005F87567; Thu, 17 Dec 2009 13:06:09 +0100 (CET) From: Alexander Graf To: qemu-devel@nongnu.org Date: Thu, 17 Dec 2009 13:06:07 +0100 Message-Id: <1261051569-7503-2-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1261051569-7503-1-git-send-email-agraf@suse.de> References: <1261051569-7503-1-git-send-email-agraf@suse.de> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 1/3] S390: Loop through virtio console devices 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 We used to always create one single virtio console device. This breaks when either zero of multiple virtio console devices are requested, so let's use the same code as on x86. Signed-off-by: Alexander Graf --- hw/s390-virtio.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index b57fa9c..e54ef0e 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -201,7 +201,11 @@ static void s390_init(ram_addr_t ram_size, } /* Create VirtIO console */ - qdev_init_nofail(qdev_create((BusState *)s390_bus, "virtio-console-s390")); + for(i = 0; i < MAX_VIRTIO_CONSOLES; i++) { + if (virtcon_hds[i]) { + qdev_init_nofail(qdev_create((BusState *)s390_bus, "virtio-console-s390")); + } + } /* Create VirtIO network adapters */ for(i = 0; i < nb_nics; i++) {