]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
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)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 21 Feb 2014 06:34:40 +0000 (00:34 -0600)
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>
(cherry picked from commit 49fb65c7f985baa56d2964e0a85c1f098e3e2a9d)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/scsi/virtio-scsi.c

index 5e524b2b13e6f977abf279c269382ca9402e6c67..3fa6d076da2c6b9a5954d5e6fbae2ce246095283 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;