s390-ccw.img: Fix sporadic reboot hangs: Initialize next_idx
authorChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 12 Feb 2014 15:17:35 +0000 (16:17 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Thu, 27 Feb 2014 08:51:25 +0000 (09:51 +0100)
The current code does not initialize next_idx in the virtio ring.
As the ccw bios will always use guest memory at a fixed location,
this queue might != 0 after a reboot.
Lets make the initialization explicit.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
pc-bios/s390-ccw/virtio.c

index 4d6e48f..a46914d 100644 (file)
@@ -124,6 +124,7 @@ static void vring_init(struct vring *vr, unsigned int num, void *p,
     vr->used->flags = VRING_USED_F_NO_NOTIFY;
     vr->used->idx = 0;
     vr->used_idx = 0;
+    vr->next_idx = 0;
 
     debug_print_addr("init vr", vr);
 }