virtio-scsi: Prevent assertion on missed events
authorEric Farman <farman@linux.vnet.ibm.com>
Tue, 14 Jan 2014 19:16:26 +0000 (14:16 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 15 Jan 2014 09:36:24 +0000 (10:36 +0100)
In some cases, an unplug can cause events to be dropped, which
leads to an assertion failure when preparing to notify the guest
kernel.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/scsi/virtio-scsi.c

index 1da98cd5571849fef842a5e1ecbf07933d03035f..6610b3aab33ddb2e7f61bdfd80982ff699f90d47 100644 (file)
@@ -520,7 +520,7 @@ 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_EVENTS_MISSED);
     } else {
         evt->lun[0] = 1;
         evt->lun[1] = dev->id;