diff options
author | Paolo Bonzini | 2016-04-06 12:16:24 +0200 |
---|---|---|
committer | Michael S. Tsirkin | 2016-04-07 18:57:33 +0200 |
commit | 43c696a298f6bef81818b1d8e64d41a160782101 (patch) | |
tree | 89a25b9b958acaaff38f353f1d71648aa5425959 /hw/scsi/virtio-scsi.c | |
parent | virtio-blk: fix disabled mode (diff) | |
download | qemu-43c696a298f6bef81818b1d8e64d41a160782101.tar.gz qemu-43c696a298f6bef81818b1d8e64d41a160782101.tar.xz qemu-43c696a298f6bef81818b1d8e64d41a160782101.zip |
virtio-scsi: fix disabled mode
Add two missing checks for s->dataplane_fenced. In one case, QEMU
would skip injecting an IRQ due to a write to an uninitialized
EventNotifier's file descriptor.
In the second case, the dataplane_disabled field was used by mistake;
in fact after fixing this occurrence it is completely unused.
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/scsi/virtio-scsi.c')
-rw-r--r-- | hw/scsi/virtio-scsi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index ade49727d6..38f1e2c2eb 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -68,7 +68,7 @@ static void virtio_scsi_complete_req(VirtIOSCSIReq *req) qemu_iovec_from_buf(&req->resp_iov, 0, &req->resp, req->resp_size); virtqueue_push(vq, &req->elem, req->qsgl.size + req->resp_iov.size); - if (s->dataplane_started) { + if (s->dataplane_started && !s->dataplane_fenced) { virtio_scsi_dataplane_notify(vdev, req); } else { virtio_notify(vdev, vq); @@ -773,7 +773,7 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, VirtIOSCSI *s = VIRTIO_SCSI(vdev); SCSIDevice *sd = SCSI_DEVICE(dev); - if (s->ctx && !s->dataplane_disabled) { + if (s->ctx && !s->dataplane_fenced) { VirtIOSCSIBlkChangeNotifier *insert_notifier, *remove_notifier; if (blk_op_is_blocked(sd->conf.blk, BLOCK_OP_TYPE_DATAPLANE, errp)) { |