From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W34v5-0003Nb-RO for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:24:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W34uw-0000lj-OM for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:24:43 -0500 Received: from e8.ny.us.ibm.com ([32.97.182.138]:53307) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W34uw-0000lT-J3 for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:24:34 -0500 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 14 Jan 2014 09:24:33 -0500 Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by d01dlp03.pok.ibm.com (Postfix) with ESMTP id 7BC64C9005E for ; Tue, 14 Jan 2014 09:24:28 -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 s0EEOUK010092816 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 s0EEOUTr002646 for ; Tue, 14 Jan 2014 09:24:30 -0500 From: Eric Farman Date: Tue, 14 Jan 2014 09:24:29 -0500 Message-Id: <1389709469-15111-4-git-send-email-farman@linux.vnet.ibm.com> In-Reply-To: <1389709469-15111-1-git-send-email-farman@linux.vnet.ibm.com> References: <1389709469-15111-1-git-send-email-farman@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 3/3] scsi/virtio-scsi: Prevent assertion on missed events List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini In some cases, an unplug can cause events to be dropped, which leads to an assertion failure when preparing to notify the guest kernel. This merely accommodates both variations of the "no event" value that could occur in this codepath. Signed-off-by: Eric Farman --- hw/scsi/virtio-scsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 49a9576..f8e3632 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -521,7 +521,8 @@ static void virtio_scsi_push_event(VirtIOSCSI *s, SCSIDevice *dev, evt->event = event; evt->reason = reason; if (!dev) { - assert(event == VIRTIO_SCSI_T_NO_EVENT); + assert(event == VIRTIO_SCSI_T_NO_EVENT || + event == VIRTIO_SCSI_T_EVENTS_MISSED); } else { evt->lun[0] = 1; evt->lun[1] = dev->id; -- 1.7.9.5