virtio-s390 devices do not perform a full reset when zero is written to the status field. The reset does not propagate down the qdev bus hierarchy. Because of this, a virtio reset does not cancel in-flight I/O for virtio-scsi.
Reported-by: Bryan Venteicher <bry...@daemoninthecloset.org> Cc: Alexander Graf <ag...@suse.de> Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- 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 e0ac2d1..91d5a3a 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.1