Skip to content

Commit

Permalink
block: assert that bs->request_alignment is a power of 2
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
plieven authored and kevmw committed Jun 8, 2016
1 parent ebd2f9e commit 107d433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block.c
Expand Up @@ -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;
Expand Down

0 comments on commit 107d433

Please sign in to comment.