From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Mv4-0007Fj-En for qemu-devel@nongnu.org; Wed, 15 Jan 2014 04:38:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3Muw-0003Zj-0K for qemu-devel@nongnu.org; Wed, 15 Jan 2014 04:37:54 -0500 Received: from mail-ee0-x22e.google.com ([2a00:1450:4013:c00::22e]:34322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Muv-0003Zb-Pj for qemu-devel@nongnu.org; Wed, 15 Jan 2014 04:37:45 -0500 Received: by mail-ee0-f46.google.com with SMTP id c13so645574eek.33 for ; Wed, 15 Jan 2014 01:37:44 -0800 (PST) Sender: Paolo Bonzini Message-ID: <52D656E5.2090702@redhat.com> Date: Wed, 15 Jan 2014 10:37:41 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1389726986-8600-1-git-send-email-farman@linux.vnet.ibm.com> In-Reply-To: <1389726986-8600-1-git-send-email-farman@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 0/3] virtio-scsi unplug of active device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Farman Cc: qemu-devel@nongnu.org Il 14/01/2014 20:16, Eric Farman ha scritto: > In working with hot-plug/unplug of virtio-scsi devices on s390, > we have occasionally noticed some erratic behavior when an unplug > occurs while I/O is in flight. Ideally a device is not being used > when it is removed from a guest configuration, but no guarantee > can be made that this will be the case. And while this scenario > is meant for I/O that occurs during normal use of a device, it > includes the pathological case of an unplug that occurs while the > asynchronous Inquiry loop (initiated by a hotplug) is still ongoing. > > Symptoms vary depending on when the unplug is recognized. Sometimes > a hang occurs, because a reference is not properly released and thus > never reaches zero. Sometimes a reference is released too early, > allowing the count to go negative and trip an assertion (or more > unpredictable results, if storage is released but still used). > > Of course there are many times when things work perfectly, though > that seems to be when the I/O was able to complete in time. These > patches simply straighten out the completion of I/Os during an > unplug, such that it results in predictable behavior whenever the > device is not idle. > > Eric Farman (3): > scsi: Assign cancel_io vector for scsi disk > scsi/virtio-scsi: Cleanup of I/Os that never started > scsi/virtio-scsi: Prevent assertion on missed events > > hw/scsi/scsi-disk.c | 1 + > hw/scsi/virtio-scsi.c | 6 +++++- > 2 files changed, 6 insertions(+), 1 deletion(-) > Thanks, applied to scsi-next branch. Paolo