Received: from eggs.gnu.org ([2001:4830:134:3::10]:46153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X212X-0002mn-SH for qemu-devel@nongnu.org; Tue, 01 Jul 2014 12:36:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X212R-0007fK-3R for qemu-devel@nongnu.org; Tue, 01 Jul 2014 12:36:17 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:53996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X212Q-0007fB-V1 for qemu-devel@nongnu.org; Tue, 01 Jul 2014 12:36:11 -0400 Received: by mail-pa0-f49.google.com with SMTP id lj1so10869320pab.22 for ; Tue, 01 Jul 2014 09:36:10 -0700 (PDT) From: Ming Lei Date: Wed, 2 Jul 2014 00:35:35 +0800 Message-Id: <1404232537-28628-3-git-send-email-ming.lei@canonical.com> In-Reply-To: <1404232537-28628-1-git-send-email-ming.lei@canonical.com> References: <1404232537-28628-1-git-send-email-ming.lei@canonical.com> Subject: [Qemu-devel] [PATCH v3 2/4] block/raw_bsd.c: support io plug and unplug for raw format image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org, Paolo Bonzini , Stefan Hajnoczi Cc: Kevin Wolf , Ming Lei , Fam Zheng , "Michael S. Tsirkin" 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 --- 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