From patchwork Mon Dec 17 16:24:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 206940 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4A7B52C0358 for ; Tue, 18 Dec 2012 04:49:47 +1100 (EST) Received: from localhost ([::1]:35606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tkeoz-0004RI-El for incoming@patchwork.ozlabs.org; Mon, 17 Dec 2012 12:49:45 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=QpCm6e29jdJeznJ11nTACae7XAJXnHQ+Qdi+ck5eW+Y=; b=MqRxCRVjKoBiPH0YpBt2EJ1Ae2b6xbVY1tR7RybLma0p8XPF4202WGFC3eVCwvhNLI M6qG6uOzKHES9OCKobidz0sAPHtOAX+AgXSXzIx6odWzccyBzLhj2uDAPLD2W6ILRH4v sFtlTLnGmLXxyH8c+cev+ruAVMoUwKzTVstPJqnZ64aPMR+lLcVmHGcgzK/3Z03fcawM lj0T2aBm43t6Br2IMsmKHxR1KE3pNdcuWHvw9pcPUwVLPVt8vu7D6/cBFLR2uPgUzJkt ZgXZ7Yq8jFHyPl7GizireTL4yslBpUW8lMb+Lepo6hgtaJe2fhhtjLj+qm5nRJ5uKC7c F/tg== Received: by 10.50.45.137 with SMTP id n9mr9575670igm.25.1355761549720; Mon, 17 Dec 2012 08:25:49 -0800 (PST) Received: from yakj.usersys.redhat.com (93-34-219-150.ip51.fastwebnet.it. [93.34.219.150]) by mx.google.com with ESMTPS id bh3sm5950327igc.0.2012.12.17.08.25.47 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Dec 2012 08:25:48 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2012 17:24:49 +0100 Message-Id: <1355761490-10073-15-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.0.2 In-Reply-To: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> References: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.223.173 Cc: aliguori@us.ibm.com, Alexander Graf , mst@redhat.com Subject: [Qemu-devel] [PATCH 14/15] virtio-s390: reset all qbuses too when writing to the status field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 */