qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Ming Lei <ming.lei@canonical.com>,
	Fam Zheng <famz@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH v3 2/4] block/raw_bsd.c: support io plug and unplug for raw format image
Date: Wed,  2 Jul 2014 00:35:35 +0800	[thread overview]
Message-ID: <1404232537-28628-3-git-send-email-ming.lei@canonical.com> (raw)
In-Reply-To: <1404232537-28628-1-git-send-email-ming.lei@canonical.com>

This patch defines .bdrv_io_plug and .bdrv_io_unplug callbacks,
so that we can support to submit IO at batch for linux-aio.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 block/raw_bsd.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index 492f58d..933822b 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -174,6 +174,16 @@ static int raw_probe(const uint8_t *buf, int buf_size, const char *filename)
     return 1;
 }
 
+static void raw_io_plug(BlockDriverState *bs)
+{
+    bdrv_io_plug(bs->file);
+}
+
+static void raw_io_unplug(BlockDriverState *bs)
+{
+    bdrv_io_unplug(bs->file);
+}
+
 static BlockDriver bdrv_raw = {
     .format_name          = "raw",
     .bdrv_probe           = &raw_probe,
@@ -198,7 +208,9 @@ static BlockDriver bdrv_raw = {
     .bdrv_ioctl           = &raw_ioctl,
     .bdrv_aio_ioctl       = &raw_aio_ioctl,
     .create_opts          = &raw_create_opts,
-    .bdrv_has_zero_init   = &raw_has_zero_init
+    .bdrv_has_zero_init   = &raw_has_zero_init,
+    .bdrv_io_plug         = &raw_io_plug,
+    .bdrv_io_unplug       = &raw_io_unplug
 };
 
 static void bdrv_raw_init(void)
-- 
1.7.9.5

  parent reply	other threads:[~2014-07-01 16:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01 16:35 [Qemu-devel] [PATCH v3 0/3] linux-aio: introduce submit I/O at batch Ming Lei
2014-07-01 16:35 ` [Qemu-devel] [PATCH v3 1/4] block: block: introduce bdrv_io_plug() and bdrv_io_unplug() Ming Lei
2014-07-01 16:35 ` Ming Lei [this message]
2014-07-01 16:35 ` [Qemu-devel] [PATCH v3 3/4] linux-aio: implement io plug and unplug Ming Lei
2014-07-01 16:35 ` [Qemu-devel] [PATCH v3 4/4] dataplane: submit I/O at batch Ming Lei
2014-07-01 17:15   ` Eric Blake
2014-07-01 17:06 ` [Qemu-devel] [PATCH v3 0/3] linux-aio: introduce " Paolo Bonzini

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=1404232537-28628-3-git-send-email-ming.lei@canonical.com \
    --to=ming.lei@canonical.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).