From: Alexander Graf Date: Thu, 17 Dec 2009 12:06:07 +0000 (+0100) Subject: S390: Loop through virtio console devices X-Git-Tag: v0.12.0~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f1e247ee6bb51728a1bdb925c48c9ce618e337e1;p=thirdparty%2Fqemu.git S390: Loop through virtio console devices 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 Signed-off-by: Aurelien Jarno (cherry picked from commit a1e4b07f04d8f31e8c0c1bf97385f426d3fcf5e6) --- diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index b57fa9c2f8b..e54ef0ea4ee 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++) {