[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/6] virtio-blk: Export request handling functions t
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH 4/6] virtio-blk: Export request handling functions to dataplane |
Date: |
Tue, 17 Jun 2014 11:44:59 +0800 |
So that dataplane can use virtio_blk_handle_request and
virtio_submit_multiwrite.
Signed-off-by: Fam Zheng <address@hidden>
---
hw/block/virtio-blk.c | 10 ++--------
include/hw/virtio/virtio-blk.h | 9 +++++++++
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index f32c663..c3133a9 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -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;
diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
index 0398f4c..d0fb26f 100644
--- a/include/hw/virtio/virtio-blk.h
+++ b/include/hw/virtio/virtio-blk.h
@@ -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
--
2.0.0
- [Qemu-devel] [PATCH 0/6] virtio-blk: Unify request handling of dataplane, Fam Zheng, 2014/06/16
- [Qemu-devel] [PATCH 1/6] block: make bdrv_query_stats() static, Fam Zheng, 2014/06/16
- [Qemu-devel] [PATCH 2/6] block: acquire AioContext in qmp_query_blockstats(), Fam Zheng, 2014/06/16
- [Qemu-devel] [PATCH 3/6] virtio-blk: Make request completion function virtual, Fam Zheng, 2014/06/16
- [Qemu-devel] [PATCH 4/6] virtio-blk: Export request handling functions to dataplane,
Fam Zheng <=
- [Qemu-devel] [PATCH 5/6] virtio-blk: Unify {non-, }dataplane's request handlings, Fam Zheng, 2014/06/16
- [Qemu-devel] [PATCH 6/6] virtio-blk: Rename complete_request_early to complete_request_vring, Fam Zheng, 2014/06/16
- Re: [Qemu-devel] [PATCH 0/6] virtio-blk: Unify request handling of dataplane, Paolo Bonzini, 2014/06/17