diff options
author | Fam Zheng <famz@redhat.com> | 2014-09-23 15:49:29 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-09-30 11:11:20 +0200 |
commit | 5170f40b102bcabed54e8fa8ec86957e35c41d41 (patch) | |
tree | fafe8cc72d6e779b7aafdf5df46c2ff6c388a623 /hw/scsi | |
parent | 1880ad4f4e3b49f15c55e816d66b9690b3ede00c (diff) |
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>
Diffstat (limited to 'hw/scsi')
-rw-r--r-- | hw/scsi/virtio-scsi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 395178e949..09a39cb991 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -488,6 +488,8 @@ bool virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req) virtio_scsi_complete_cmd_req(req); return false; } + scsi_req_ref(req->sreq); + bdrv_io_plug(d->conf.bs); return true; } @@ -496,6 +498,8 @@ void virtio_scsi_handle_cmd_req_submit(VirtIOSCSI *s, VirtIOSCSIReq *req) if (scsi_req_enqueue(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) |