From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W35HB-0004HG-1D for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:47:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W35H5-00086Z-29 for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:47:32 -0500 Received: from mx1.redhat.com ([209.132.183.28]:17745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W35H4-00086T-Mi for qemu-devel@nongnu.org; Tue, 14 Jan 2014 09:47:26 -0500 Message-ID: <52D54DF8.2000207@redhat.com> Date: Tue, 14 Jan 2014 15:47:20 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1389709469-15111-1-git-send-email-farman@linux.vnet.ibm.com> <1389709469-15111-4-git-send-email-farman@linux.vnet.ibm.com> In-Reply-To: <1389709469-15111-4-git-send-email-farman@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [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: Eric Farman Cc: qemu-devel@nongnu.org Il 14/01/2014 15:24, Eric Farman ha scritto: > 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; > Ugh, you're right. In fact, you can only have event == VIRTIO_SCSI_T_EVENTS_MISSED at this point. Can you make v2 that completely replaces the condition? Paolo