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 <[email protected]> --- 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
