qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: [Qemu-devel] [PATCH v2 4/7] virtio-blk: Export request handling functions to dataplane
Date: Tue, 17 Jun 2014 14:32:07 +0800	[thread overview]
Message-ID: <1402986730-25642-5-git-send-email-famz@redhat.com> (raw)
In-Reply-To: <1402986730-25642-1-git-send-email-famz@redhat.com>

So that dataplane can use virtio_blk_handle_request and
virtio_submit_multiwrite.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 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 aed580c..25c3812 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

  parent reply	other threads:[~2014-06-17  6:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17  6:32 [Qemu-devel] [PATCH v2 0/7] virtio-blk: Unify request handling of dataplane Fam Zheng
2014-06-17  6:32 ` [Qemu-devel] [PATCH v2 1/7] block: make bdrv_query_stats() static Fam Zheng
2014-06-17  6:32 ` [Qemu-devel] [PATCH v2 2/7] block: acquire AioContext in qmp_query_blockstats() Fam Zheng
2014-06-17  6:32 ` [Qemu-devel] [PATCH v2 3/7] virtio-blk: Make request completion function virtual Fam Zheng
2014-06-17  6:32 ` Fam Zheng [this message]
2014-06-17  6:32 ` [Qemu-devel] [PATCH v2 5/7] virtio-blk: Schedule BH in the right context Fam Zheng
2014-06-17  6:32 ` [Qemu-devel] [PATCH v2 6/7] virtio-blk: Unify {non-, }dataplane's request handlings Fam Zheng
2014-07-01 11:29   ` Max Reitz
2014-07-01 13:22     ` Stefan Hajnoczi
2014-06-17  6:32 ` [Qemu-devel] [PATCH v2 7/7] virtio-blk: Rename complete_request_early to complete_request_vring Fam Zheng
2014-06-17  8:53 ` [Qemu-devel] [PATCH v2 0/7] virtio-blk: Unify request handling of dataplane Paolo Bonzini
2014-06-27 16:01 ` Stefan Hajnoczi
2014-06-27 16:21   ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1402986730-25642-5-git-send-email-famz@redhat.com \
    --to=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).