block: assert that bs->request_alignment is a power of 2
PATCH 1/1 block: assert that bs->request_alignment is a power of 2
at least bdrv_co_preadv/pwritev expect this.
Signed-off-by Peter Lieven <[email protected]>
--- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block.c +1 -1
@@ -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 ;
Signature · 1 line
1.9.1
Quoted 6 lines · Peter Lieven
at least bdrv_co_preadv/pwritev expect this.
Signed-off-by Peter Lieven <[email protected]>--- block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Eric Blake <[email protected]>
And my work on converting write_zeroes to a byte interface will also exploit it.
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Kevin Wolf
AppliedAm 30.05.2016 um 13:59 hat Peter Lieven geschrieben:
Quoted 3 lines
at least bdrv_co_preadv/pwritev expect this.
Signed-off-by Peter Lieven <[email protected]>
Thanks, applied to the block branch.
Kevin