qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: assert that bs->request_alignment is a power of 2
@ 2016-05-30 11:59 Peter Lieven
  2016-05-31 18:28 ` Eric Blake
  2016-06-02 14:47 ` Kevin Wolf
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Lieven @ 2016-05-30 11:59 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, kwolf, mreitz, Peter Lieven

at least bdrv_co_preadv/pwritev expect this.

Signed-off-by: Peter Lieven <pl@kamp.de>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 736432f..f54bc25 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;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-02 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-30 11:59 [Qemu-devel] [PATCH] block: assert that bs->request_alignment is a power of 2 Peter Lieven
2016-05-31 18:28 ` Eric Blake
2016-06-02 14:47 ` Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).