From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdVp-0001AB-3N for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkdVm-0008ON-MI for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:52 -0500 Received: from mail-ie0-f173.google.com ([209.85.223.173]:56330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdVm-0008OG-HU for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:50 -0500 Received: by mail-ie0-f173.google.com with SMTP id e13so9604668iej.4 for ; Mon, 17 Dec 2012 08:25:50 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 17 Dec 2012 17:24:49 +0100 Message-Id: <1355761490-10073-15-git-send-email-pbonzini@redhat.com> In-Reply-To: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> References: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 14/15] virtio-s390: reset all qbuses too when writing to the status field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, Alexander Graf , mst@redhat.com 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 Cc: Alexander Graf Signed-off-by: Paolo Bonzini --- 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