From 107d433cbbc347cdd140c0f2de4574ff3675bdbe Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Mon, 30 May 2016 13:59:59 +0200 Subject: [PATCH] block: assert that bs->request_alignment is a power of 2 at least bdrv_co_preadv/pwritev expect this. Signed-off-by: Peter Lieven Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block.c b/block.c index 736432f67e..f54bc25e8a 100644 --- a/block.c +++ b/block.c @@ -1018,7 +1018,7 @@ static int bdrv_open_common(BlockDriverState *bs, BdrvChild *file, assert(bdrv_opt_mem_align(bs) != 0); assert(bdrv_min_mem_align(bs) != 0); - assert((bs->request_alignment != 0) || bdrv_is_sg(bs)); + assert(is_power_of_2(bs->request_alignment) || bdrv_is_sg(bs)); qemu_opts_del(opts); return 0;