]> git.proxmox.com Git - qemu.git/commitdiff
S390: Loop through virtio console devices
authorAlexander Graf <agraf@suse.de>
Thu, 17 Dec 2009 12:06:07 +0000 (13:06 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 18 Dec 2009 15:34:20 +0000 (16:34 +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 <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
hw/s390-virtio.c

index b57fa9c2f8b52e4b95ae3a316302f0021351ad5e..e54ef0ea4ee54df45e3d1d8a3a3e51a1bd75aa00 100644 (file)
@@ -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++) {