summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Freimann <jfrei@linux.vnet.ibm.com>2012-04-22 23:52:21 +0000
committerAlexander Graf <agraf@suse.de>2012-05-01 21:04:06 +0200
commiteb3caa44b03f5d72a49a18c72443825b58168734 (patch)
tree44dee707022402f9cd5925b20271848367ae263d
parent118a89774346e6a406cd44f403cb043a417066c9 (diff)
downloadqemu-eb3caa44b03f5d72a49a18c72443825b58168734.tar.gz
qemu-eb3caa44b03f5d72a49a18c72443825b58168734.tar.bz2
qemu-eb3caa44b03f5d72a49a18c72443825b58168734.zip
S390: reboot: reset device pages on reboot
This patch fixes reboot on s390 by resetting the device page on reboot. Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r--hw/s390-virtio-bus.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index be1f5f1061..74419b3725 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -57,6 +57,12 @@ static ram_addr_t s390_virtio_device_num_vq(VirtIOS390Device *dev);
/* length of VirtIO device pages */
const target_phys_addr_t virtio_size = S390_DEVICE_PAGES * TARGET_PAGE_SIZE;
+static void s390_virtio_bus_reset(void *opaque)
+{
+ VirtIOS390Bus *bus = opaque;
+ bus->next_ring = bus->dev_page + TARGET_PAGE_SIZE;
+}
+
VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)
{
VirtIOS390Bus *bus;
@@ -82,6 +88,7 @@ VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)
/* Allocate RAM for VirtIO device pages (descriptors, queues, rings) */
*ram_size += S390_DEVICE_PAGES * TARGET_PAGE_SIZE;
+ qemu_register_reset(s390_virtio_bus_reset, bus);
return bus;
}