virtio-blk: Export request handling functions to dataplane
So that dataplane can use virtio_blk_handle_request and virtio_submit_multiwrite. Signed-off-by: Fam Zheng <famz@redhat.com> Tested-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
bf4bd461b4
commit
fee65db771
@ -253,12 +253,7 @@ static void virtio_blk_handle_scsi(VirtIOBlockReq *req)
|
||||
virtio_blk_free_request(req);
|
||||
}
|
||||
|
||||
typedef struct MultiReqBuffer {
|
||||
BlockRequest blkreq[32];
|
||||
unsigned int num_writes;
|
||||
} MultiReqBuffer;
|
||||
|
||||
static void virtio_submit_multiwrite(BlockDriverState *bs, MultiReqBuffer *mrb)
|
||||
void virtio_submit_multiwrite(BlockDriverState *bs, MultiReqBuffer *mrb)
|
||||
{
|
||||
int i, ret;
|
||||
|
||||
@ -347,8 +342,7 @@ static void virtio_blk_handle_read(VirtIOBlockReq *req)
|
||||
virtio_blk_rw_complete, req);
|
||||
}
|
||||
|
||||
static void virtio_blk_handle_request(VirtIOBlockReq *req,
|
||||
MultiReqBuffer *mrb)
|
||||
void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb)
|
||||
{
|
||||
uint32_t type;
|
||||
struct iovec *in_iov = req->elem->in_sg;
|
||||
|
@ -137,6 +137,11 @@ typedef struct VirtIOBlock {
|
||||
#endif
|
||||
} VirtIOBlock;
|
||||
|
||||
typedef struct MultiReqBuffer {
|
||||
BlockRequest blkreq[32];
|
||||
unsigned int num_writes;
|
||||
} MultiReqBuffer;
|
||||
|
||||
typedef struct VirtIOBlockReq {
|
||||
VirtIOBlock *dev;
|
||||
VirtQueueElement *elem;
|
||||
@ -172,4 +177,8 @@ void virtio_blk_set_conf(DeviceState *dev, VirtIOBlkConf *blk);
|
||||
int virtio_blk_handle_scsi_req(VirtIOBlock *blk,
|
||||
VirtQueueElement *elem);
|
||||
|
||||
void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb);
|
||||
|
||||
void virtio_submit_multiwrite(BlockDriverState *bs, MultiReqBuffer *mrb);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user