From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W34v6-0003Nd-8N for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W34ux-0000m4-5T for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:24:44 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:48788) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W34uw-0000lX-UQ for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:24:35 -0500 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Jan 2014 07:24:33 -0700 Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id B0D026E8041 for ; Tue, 14 Jan 2014 09:24:26 -0500 (EST) Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by b01cxnp22035.gho.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s0EEOUV910092814 for ; Tue, 14 Jan 2014 14:24:30 GMT Received: from d01av04.pok.ibm.com (localhost [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s0EEOTsW002609 for ; Tue, 14 Jan 2014 09:24:30 -0500 From: Eric Farman Date: Tue, 14 Jan 2014 09:24:26 -0500 Message-Id: <1389709469-15111-1-git-send-email-farman@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH RFC 0/3] virtio-scsi unplug of active device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini 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 not 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/virtio-scsi: Properly flush I/Os inflight during an unplug scsi/virtio-scsi: Cleanup of I/Os that never started scsi/virtio-scsi: Prevent assertion on missed events hw/scsi/virtio-scsi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.7.9.5