From patchwork Thu Dec 17 12:06:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/3] S390: Loop through virtio console devices From: Alexander Graf X-Patchwork-Id: 41307 Message-Id: <1261051569-7503-2-git-send-email-agraf@suse.de> To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net Date: Thu, 17 Dec 2009 13:06:07 +0100 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++) {