virtio-scsi: Call bdrv_io_plug/bdrv_io_unplug in cmd request handling

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Fam Zheng 2014-09-23 15:49:29 +08:00 committed by Paolo Bonzini
parent 1880ad4f4e
commit 5170f40b10

View File

@ -488,6 +488,8 @@ bool virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req)
virtio_scsi_complete_cmd_req(req); virtio_scsi_complete_cmd_req(req);
return false; return false;
} }
scsi_req_ref(req->sreq);
bdrv_io_plug(d->conf.bs);
return true; return true;
} }
@ -496,6 +498,8 @@ void virtio_scsi_handle_cmd_req_submit(VirtIOSCSI *s, VirtIOSCSIReq *req)
if (scsi_req_enqueue(req->sreq)) { if (scsi_req_enqueue(req->sreq)) {
scsi_req_continue(req->sreq); scsi_req_continue(req->sreq);
} }
bdrv_io_unplug(req->sreq->dev->conf.bs);
scsi_req_unref(req->sreq);
} }
static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq) static void virtio_scsi_handle_cmd(VirtIODevice *vdev, VirtQueue *vq)