aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2016-05-30 13:59:59 +0200
committerKevin Wolf <kwolf@redhat.com>2016-06-08 10:21:09 +0200
commit107d433cbbc347cdd140c0f2de4574ff3675bdbe (patch)
treeb329039083e6975043507e9cfa6d788d4ffc3de6
parentebd2f9e7db4b6cbc2f144b9cef397503b3e956b5 (diff)
block: assert that bs->request_alignment is a power of 2
at least bdrv_co_preadv/pwritev expect this. Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r--block.c2
1 files changed, 1 insertions, 1 deletions
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;