From f0a9c18f9e72ab66d3c57c5c3a43137deb534076 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 11 Oct 2017 22:47:20 -0500 Subject: qemu-io: Relax 'alloc' now that block-status doesn't assert Previously, the alloc command required that input parameters be sector-aligned and clamped to 32 bits, because the underlying bdrv_is_allocated used a 32-bit parameter and asserted aligned inputs. But now that we have fixed block status to report a 64-bit bytes value, and to properly round requests on behalf of guests, we can pass any values, and can use qemu-io to add coverage that our rounding is correct regardless of the guest alignment constraints. Update iotest 177 to intentionally probe block status at unaligned boundaries as well as with a bytes value that does not map to 32-bit sectors, which also required tweaking the image prep to leave an unallocated portion to the image under test. Signed-off-by: Eric Blake Signed-off-by: Kevin Wolf --- qemu-io-cmds.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'qemu-io-cmds.c') diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 3727fb43f3..de8e3de726 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1769,10 +1769,6 @@ static int alloc_f(BlockBackend *blk, int argc, char **argv) if (offset < 0) { print_cvtnum_err(offset, argv[1]); return 0; - } else if (!QEMU_IS_ALIGNED(offset, BDRV_SECTOR_SIZE)) { - printf("%" PRId64 " is not a sector-aligned value for 'offset'\n", - offset); - return 0; } if (argc == 3) { @@ -1780,19 +1776,10 @@ static int alloc_f(BlockBackend *blk, int argc, char **argv) if (count < 0) { print_cvtnum_err(count, argv[2]); return 0; - } else if (count > INT_MAX * BDRV_SECTOR_SIZE) { - printf("length argument cannot exceed %llu, given %s\n", - INT_MAX * BDRV_SECTOR_SIZE, argv[2]); - return 0; } } else { count = BDRV_SECTOR_SIZE; } - if (!QEMU_IS_ALIGNED(count, BDRV_SECTOR_SIZE)) { - printf("%" PRId64 " is not a sector-aligned value for 'count'\n", - count); - return 0; - } remaining = count; sum_alloc = 0; -- cgit v1.2.1