qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 14/15] virtio-s390: reset all qbuses too when writin


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 14/15] virtio-s390: reset all qbuses too when writing to the status field
Date: Mon, 17 Dec 2012 17:24:49 +0100

virtio-s390 devices do not perform a reset when zero is written to the
status byte.  Because of this, a virtio reset does not cancel in-flight
I/O for virtio-scsi.

Use qdev_reset_all so that the reset correctly propagates down the qdev
bus hierarchy.

Reported-by: Bryan Venteicher <address@hidden>
Cc: Alexander Graf <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 hw/s390-virtio-bus.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index 34173a7..b8465d1 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -309,8 +309,14 @@ void s390_virtio_device_update_status(VirtIOS390Device 
*dev)
 {
     VirtIODevice *vdev = dev->vdev;
     uint32_t features;
+    unsigned char status;
 
-    virtio_set_status(vdev, ldub_phys(dev->dev_offs + VIRTIO_DEV_OFFS_STATUS));
+    status = ldub_phys(dev->dev_offs + VIRTIO_DEV_OFFS_STATUS);
+    if (status == 0) {
+        qdev_reset_all((DeviceState *)dev);
+    }
+
+    virtio_set_status(vdev, status);
 
     /* Update guest supported feature bitmap */
 
-- 
1.8.0.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]