aboutsummaryrefslogtreecommitdiff
path: root/hw/block/virtio-blk.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2015-01-20 11:28:46 +0800
committerKevin Wolf <kwolf@redhat.com>2015-01-23 18:17:05 +0100
commit75344fa4c5d6a3ebe2dec2d87cbea8524f5d0f42 (patch)
tree4426d3c3037a829dddeee457cf7579d80c9605c5 /hw/block/virtio-blk.c
parentc6441452b50c44fdbb362b239ce623f77cf3cd51 (diff)
virtio-blk: Pass req to virtio_blk_handle_scsi_req
In preparation for calling blk_aio_ioctl. Also make the function static as no other files need it. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/block/virtio-blk.c')
-rw-r--r--hw/block/virtio-blk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index b19b102b42..60cb1d88ed 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -127,12 +127,13 @@ static VirtIOBlockReq *virtio_blk_get_request(VirtIOBlock *s)
return req;
}
-int virtio_blk_handle_scsi_req(VirtIOBlock *blk,
- VirtQueueElement *elem)
+static int virtio_blk_handle_scsi_req(VirtIOBlockReq *req)
{
int status = VIRTIO_BLK_S_OK;
struct virtio_scsi_inhdr *scsi = NULL;
- VirtIODevice *vdev = VIRTIO_DEVICE(blk);
+ VirtIODevice *vdev = VIRTIO_DEVICE(req->dev);
+ VirtQueueElement *elem = &req->elem;
+ VirtIOBlock *blk = req->dev;
#ifdef __linux__
int i;
@@ -252,7 +253,7 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
{
int status;
- status = virtio_blk_handle_scsi_req(req->dev, &req->elem);
+ status = virtio_blk_handle_scsi_req(req);
virtio_blk_req_complete(req, status);
virtio_blk_free_request(req);
}