]> git.proxmox.com Git - qemu.git/commitdiff
Implement virtio reset
authorAlexander Graf <agraf@suse.de>
Thu, 1 Apr 2010 16:42:40 +0000 (18:42 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Fri, 9 Apr 2010 20:06:22 +0000 (22:06 +0200)
The guest may issue a RESET command for virtio. So far we didn't bother
to implement it, but with my new bootloader we actually need it for Linux
to get back to a safe state.

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
hw/s390-virtio-bus.c
hw/s390-virtio-bus.h
hw/s390-virtio.c

index 3efbaabb66d628bbabdd58b3af56759db69a0b99..fe6884d47d67b5c8eeeb5c907e7b62d33a529687 100644 (file)
@@ -56,7 +56,6 @@ typedef struct {
 static const VirtIOBindings virtio_s390_bindings;
 
 static ram_addr_t s390_virtio_device_num_vq(VirtIOS390Device *dev);
-static void s390_virtio_device_sync(VirtIOS390Device *dev);
 
 VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)
 {
@@ -185,7 +184,7 @@ static ram_addr_t s390_virtio_next_ring(VirtIOS390Bus *bus)
     return r;
 }
 
-static void s390_virtio_device_sync(VirtIOS390Device *dev)
+void s390_virtio_device_sync(VirtIOS390Device *dev)
 {
     VirtIOS390Bus *bus = DO_UPCAST(VirtIOS390Bus, bus, dev->qdev.parent_bus);
     ram_addr_t cur_offs;
index 0ea8f54745ded3a72d3fab0ca167ea3c97defbe2..333fea8963d0b25b4dd1fda2d7dcfc31427296a9 100644 (file)
@@ -65,3 +65,4 @@ extern VirtIOS390Device *s390_virtio_bus_find_vring(VirtIOS390Bus *bus,
                                                     int *vq_num);
 extern VirtIOS390Device *s390_virtio_bus_find_mem(VirtIOS390Bus *bus,
                                                   ram_addr_t mem);
+extern void s390_virtio_device_sync(VirtIOS390Device *dev);
index ad3386f6076f6308bb6b6e03df080faf172879a3..c36a8b2336a95317da49bb2cff4a92ced9f939f3 100644 (file)
@@ -99,10 +99,11 @@ int s390_virtio_hypercall(CPUState *env)
         break;
     case KVM_S390_VIRTIO_RESET:
     {
-        /* Virtio_reset resets the internal addresses, so we'd have to sync
-           them up again. We don't want to reallocate a vring though, so let's
-           just not reset. */
-        /* virtio_reset(dev->vdev); */
+        VirtIOS390Device *dev;
+
+        dev = s390_virtio_bus_find_mem(s390_bus, mem);
+        virtio_reset(dev->vdev);
+        s390_virtio_device_sync(dev);
         break;
     }
     case KVM_S390_VIRTIO_SET_STATUS: