:p
atchew
Login
The following changes since commit 22d96eac64877c4d96f9928babb6f2fcc68faacf: Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging (2019-04-29 19:11:15 +0100) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch changes up to 54277a2aab876aba7b55c7e88e2b372691849741: block/qed: add missed coroutine_fn markers (2019-04-30 15:29:00 +0200) ---------------------------------------------------------------- Block layer patches: - iotests: Fix output of qemu-io related tests - Don't ignore bdrv_set_aio_context() for nodes with bs->drv = NUL - vmdk: Set vmdk parent backing_format to vmdk - qcow2: Preallocation fixes (especially for external data files) - Add linear-buffer-based APIs (as wrappers around qiov-based ones) - Various code cleanups and small corner case fixes ---------------------------------------------------------------- Alberto Garcia (3): qcow2: Fix error handling in the compression code commit: Make base read-only if there is an early failure iotests: Check that images are in read-only mode after block-commit Eric Blake (2): cutils: Fix size_to_str() on 32-bit platforms qemu-img: Saner printing of large file sizes Kevin Wolf (5): block: Fix AioContext switch for bs->drv == NULL qcow2: Avoid COW during metadata preallocation qcow2: Add errp to preallocate_co() qcow2: Fix full preallocation with external data file qcow2: Fix qcow2_make_empty() with external data file Max Reitz (2): iotests: Perform the correct test in 082 qemu-img: Make create hint at protocol options Sam Eiderman (1): vmdk: Set vmdk parent backing_format to vmdk Stefano Garzarella (2): block/vhdx: Remove redundant IEC binary prefixes definition block/vhdx: Use IEC binary prefixes for size constants Thomas Huth (1): tests/qemu-iotests: Fix output of qemu-io related tests Vladimir Sementsov-Ogievskiy (10): block: introduce byte-based io helpers block/qcow2: use buffer-based io block/qcow: use buffer-based io block/qed: use buffer-based io block/parallels: use buffer-based io block/backup: use buffer-based io block/commit: use buffer-based io block/stream: use buffer-based io qemu-img: use buffer-based io block/qed: add missed coroutine_fn markers Zhengui li (1): vpc: unlock Coroutine lock to make IO submit Concurrently block/qed.h | 28 ++++--- block/vhdx.h | 16 ++-- include/block/block_int.h | 16 ++++ include/sysemu/block-backend.h | 19 +++++ block.c | 12 +-- block/backup.c | 14 ++-- block/commit.c | 8 +- block/parallels.c | 14 ++-- block/qapi.c | 49 +++--------- block/qcow.c | 19 ++--- block/qcow2.c | 80 ++++++++++---------- block/qed-check.c | 4 +- block/qed-table.c | 45 ++++++----- block/qed.c | 11 ++- block/stream.c | 4 +- block/vhdx-log.c | 2 +- block/vhdx.c | 7 +- block/vmdk.c | 2 + block/vpc.c | 4 + qemu-img.c | 26 ++++--- util/cutils.c | 2 +- tests/qemu-iotests/026.out | 168 ++++++++++++++++++++--------------------- tests/qemu-iotests/043.out | 6 +- tests/qemu-iotests/053.out | 2 +- tests/qemu-iotests/059.out | 10 +-- tests/qemu-iotests/060.out | 16 ++-- tests/qemu-iotests/061.out | 12 +-- tests/qemu-iotests/069.out | 2 +- tests/qemu-iotests/070.out | 4 +- tests/qemu-iotests/075.out | 14 ++-- tests/qemu-iotests/076.out | 6 +- tests/qemu-iotests/078.out | 12 +-- tests/qemu-iotests/080.out | 40 +++++----- tests/qemu-iotests/081.out | 2 +- tests/qemu-iotests/082 | 5 +- tests/qemu-iotests/082.out | 51 ++++++++----- tests/qemu-iotests/084.out | 8 +- tests/qemu-iotests/088.out | 12 +-- tests/qemu-iotests/089.out | 2 +- tests/qemu-iotests/095.out | 4 +- tests/qemu-iotests/103.out | 14 ++-- tests/qemu-iotests/104.out | 6 +- tests/qemu-iotests/110.out | 6 +- tests/qemu-iotests/114.out | 4 +- tests/qemu-iotests/116.out | 14 ++-- tests/qemu-iotests/126.out | 4 +- tests/qemu-iotests/130.out | 10 +-- tests/qemu-iotests/131.out | 2 +- tests/qemu-iotests/133.out | 30 ++++---- tests/qemu-iotests/137.out | 28 +++---- tests/qemu-iotests/140.out | 2 +- tests/qemu-iotests/143.out | 2 +- tests/qemu-iotests/153.out | 32 ++++---- tests/qemu-iotests/187.out | 6 +- tests/qemu-iotests/188.out | 2 +- tests/qemu-iotests/191.out | 8 +- tests/qemu-iotests/195.out | 4 +- tests/qemu-iotests/197.out | 2 +- tests/qemu-iotests/198.out | 4 +- tests/qemu-iotests/205 | 2 +- tests/qemu-iotests/206.out | 10 +-- tests/qemu-iotests/207.out | 12 +-- tests/qemu-iotests/210.out | 8 +- tests/qemu-iotests/211.out | 10 +-- tests/qemu-iotests/212.out | 10 +-- tests/qemu-iotests/213.out | 10 +-- tests/qemu-iotests/215.out | 2 +- tests/qemu-iotests/226.out | 16 ++-- tests/qemu-iotests/233.out | 4 +- tests/qemu-iotests/237.out | 22 +++--- tests/qemu-iotests/242.out | 10 +-- tests/qemu-iotests/244.out | 10 +-- tests/qemu-iotests/249 | 115 ++++++++++++++++++++++++++++ tests/qemu-iotests/249.out | 35 +++++++++ tests/qemu-iotests/group | 1 + 75 files changed, 696 insertions(+), 519 deletions(-) create mode 100755 tests/qemu-iotests/249 create mode 100644 tests/qemu-iotests/249.out
From: Thomas Huth <thuth@redhat.com> One of the recent commits changed the way qemu-io prints out its errors and warnings - they are now prefixed with the program name. We've got to adapt the iotests accordingly to prevent that they are failing. Fixes: 99e98d7c9fc1a1639fad ("qemu-io: Use error_[gs]et_progname()") Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- tests/qemu-iotests/026.out | 168 ++++++++++++++++++------------------- tests/qemu-iotests/060.out | 6 +- tests/qemu-iotests/069.out | 2 +- tests/qemu-iotests/070.out | 2 +- tests/qemu-iotests/075.out | 14 ++-- tests/qemu-iotests/076.out | 6 +- tests/qemu-iotests/078.out | 12 +-- tests/qemu-iotests/080.out | 40 ++++----- tests/qemu-iotests/081.out | 2 +- tests/qemu-iotests/088.out | 12 +-- tests/qemu-iotests/103.out | 14 ++-- tests/qemu-iotests/114.out | 2 +- tests/qemu-iotests/116.out | 14 ++-- tests/qemu-iotests/131.out | 2 +- tests/qemu-iotests/133.out | 30 +++---- tests/qemu-iotests/137.out | 28 +++---- tests/qemu-iotests/140.out | 2 +- tests/qemu-iotests/143.out | 2 +- tests/qemu-iotests/153.out | 30 +++---- tests/qemu-iotests/187.out | 6 +- tests/qemu-iotests/188.out | 2 +- tests/qemu-iotests/197.out | 2 +- tests/qemu-iotests/205 | 2 +- tests/qemu-iotests/215.out | 2 +- tests/qemu-iotests/226.out | 16 ++-- tests/qemu-iotests/244.out | 10 +-- 26 files changed, 214 insertions(+), 214 deletions(-) diff --git a/tests/qemu-iotests/026.out b/tests/qemu-iotests/026.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/026.out +++ b/tests/qemu-iotests/026.out @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l1_update; errno: 5; imm: off; once: off; write -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error 1 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l1_update; errno: 5; imm: off; once: off; write -b -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error 1 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l1_update; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 1 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l1_update; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 1 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l2_update; errno: 5; imm: off; once: off; write -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error 127 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l2_update; errno: 5; imm: off; once: off; write -b -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error 127 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l2_update; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 127 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l2_update; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 127 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l2_alloc_write; errno: 5; imm: off; once: off; write -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l2_alloc_write; errno: 5; imm: off; once: off; write -b -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error 1 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l2_alloc_write; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l2_alloc_write; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 1 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: write_aio; errno: 5; imm: off; once: off; write -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: write_aio; errno: 5; imm: off; once: off; write -b -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: write_aio; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: write_aio; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_load; errno: 5; imm: off; once: off; write -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_load; errno: 5; imm: off; once: off; write -b -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_load; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_load; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_update_part; errno: 5; imm: off; once: off; write -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_update_part; errno: 5; imm: off; once: off; write -b -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_update_part; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_update_part; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc; errno: 5; imm: off; once: off; write -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc; errno: 5; imm: off; once: off; write -b -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 55 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_hookup; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 251 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_write; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_write; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 10 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_write_blocks; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 23 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 10 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_write_table; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 23 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 10 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ This means waste of disk space, but no harm to data. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: refblock_alloc_switch_table; errno: 28; imm: off; once: off; write -b -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 23 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l1_grow_write_table; errno: 5; imm: off; once: off -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l1_grow_write_table; errno: 28; imm: off; once: off -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l1_grow_activate_table; errno: 5; imm: off; once: off -Failed to flush the L2 table cache: Input/output error -Failed to flush the refcount block cache: Input/output error +qemu-io: Failed to flush the L2 table cache: Input/output error +qemu-io: Failed to flush the refcount block cache: Input/output error write failed: Input/output error 96 leaked clusters were found on the image. @@ -XXX,XX +XXX,XX @@ No errors were found on the image. Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824 Event: l1_grow_activate_table; errno: 28; imm: off; once: off -Failed to flush the L2 table cache: No space left on device -Failed to flush the refcount block cache: No space left on device +qemu-io: Failed to flush the L2 table cache: No space left on device +qemu-io: Failed to flush the refcount block cache: No space left on device write failed: No space left on device 96 leaked clusters were found on the image. diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/060.out +++ b/tests/qemu-iotests/060.out @@ -XXX,XX +XXX,XX @@ Format specific information: lazy refcounts: false refcount bits: 16 corrupt: true -can't open device TEST_DIR/t.IMGFMT: IMGFMT: Image is corrupt; cannot be opened read/write +qemu-io: can't open device TEST_DIR/t.IMGFMT: IMGFMT: Image is corrupt; cannot be opened read/write no file open, try 'help open' read 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -XXX,XX +XXX,XX @@ No errors were found on the image. === Testing zero refcount table size === Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.IMGFMT: Image does not contain a reference count table +qemu-io: can't open device TEST_DIR/t.IMGFMT: Image does not contain a reference count table ERROR cluster 0 refcount=0 reference=1 ERROR cluster 3 refcount=0 reference=1 Rebuilding refcount structure @@ -XXX,XX +XXX,XX @@ Can't get refcount for cluster 2: Input/output error Can't get refcount for cluster 3: Input/output error Rebuilding refcount structure Repairing cluster 1 refcount=1 reference=0 -can't open device TEST_DIR/t.IMGFMT: Could not repair dirty image: Input/output error +qemu-io: can't open device TEST_DIR/t.IMGFMT: Could not repair dirty image: Input/output error --- Repairing --- Leaked cluster 1 refcount=1 reference=0 Repairing cluster 1 refcount=1 reference=0 diff --git a/tests/qemu-iotests/069.out b/tests/qemu-iotests/069.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/069.out +++ b/tests/qemu-iotests/069.out @@ -XXX,XX +XXX,XX @@ QA output created by 069 Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=131072 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=131072 backing_file=TEST_DIR/t.IMGFMT.base -can't open device TEST_DIR/t.IMGFMT: Could not open backing file: Could not open 'TEST_DIR/t.IMGFMT.base': No such file or directory +qemu-io: can't open device TEST_DIR/t.IMGFMT: Could not open backing file: Could not open 'TEST_DIR/t.IMGFMT.base': No such file or directory *** done diff --git a/tests/qemu-iotests/070.out b/tests/qemu-iotests/070.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/070.out +++ b/tests/qemu-iotests/070.out @@ -XXX,XX +XXX,XX @@ QA output created by 070 === Verify open image read-only fails, due to dirty log === -can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image file 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' opened read-only, but contains a log that needs to be replayed +qemu-io: can't open device TEST_DIR/iotest-dirtylog-10G-4M.vhdx: VHDX image file 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' opened read-only, but contains a log that needs to be replayed To replay the log, run: qemu-img check -r all 'TEST_DIR/iotest-dirtylog-10G-4M.vhdx' === Verify open image replays log === diff --git a/tests/qemu-iotests/075.out b/tests/qemu-iotests/075.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/075.out +++ b/tests/qemu-iotests/075.out @@ -XXX,XX +XXX,XX @@ read 512/512 bytes at offset 1048064 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) == block_size must be a multiple of 512 == -can't open device TEST_DIR/simple-pattern.cloop: block_size 513 must be a multiple of 512 +qemu-io: can't open device TEST_DIR/simple-pattern.cloop: block_size 513 must be a multiple of 512 == block_size cannot be zero == -can't open device TEST_DIR/simple-pattern.cloop: block_size cannot be zero +qemu-io: can't open device TEST_DIR/simple-pattern.cloop: block_size cannot be zero == huge block_size === -can't open device TEST_DIR/simple-pattern.cloop: block_size 4294966784 must be 64 MB or less +qemu-io: can't open device TEST_DIR/simple-pattern.cloop: block_size 4294966784 must be 64 MB or less == offsets_size overflow === -can't open device TEST_DIR/simple-pattern.cloop: n_blocks 4294967295 must be 536870911 or less +qemu-io: can't open device TEST_DIR/simple-pattern.cloop: n_blocks 4294967295 must be 536870911 or less == refuse images that require too many offsets === -can't open device TEST_DIR/simple-pattern.cloop: image requires too many offsets, try increasing block size +qemu-io: can't open device TEST_DIR/simple-pattern.cloop: image requires too many offsets, try increasing block size == refuse images with non-monotonically increasing offsets == -can't open device TEST_DIR/simple-pattern.cloop: offsets not monotonically increasing at index 1, image file is corrupt +qemu-io: can't open device TEST_DIR/simple-pattern.cloop: offsets not monotonically increasing at index 1, image file is corrupt == refuse images with invalid compressed block size == -can't open device TEST_DIR/simple-pattern.cloop: invalid compressed block size at index 1, image file is corrupt +qemu-io: can't open device TEST_DIR/simple-pattern.cloop: invalid compressed block size at index 1, image file is corrupt *** done diff --git a/tests/qemu-iotests/076.out b/tests/qemu-iotests/076.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/076.out +++ b/tests/qemu-iotests/076.out @@ -XXX,XX +XXX,XX @@ read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) == Negative catalog size == -can't open device TEST_DIR/parallels-v1: Catalog too large +qemu-io: can't open device TEST_DIR/parallels-v1: Catalog too large == Overflow in catalog allocation == -can't open device TEST_DIR/parallels-v1: Catalog too large +qemu-io: can't open device TEST_DIR/parallels-v1: Catalog too large == Zero sectors per track == -can't open device TEST_DIR/parallels-v1: Invalid image: Zero sectors per track +qemu-io: can't open device TEST_DIR/parallels-v1: Invalid image: Zero sectors per track == Read from a valid v2 image == read 65536/65536 bytes at offset 0 diff --git a/tests/qemu-iotests/078.out b/tests/qemu-iotests/078.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/078.out +++ b/tests/qemu-iotests/078.out @@ -XXX,XX +XXX,XX @@ read 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) == Negative catalog size == -can't open device TEST_DIR/empty.bochs: Catalog size is too large +qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too large == Overflow for catalog size * sizeof(uint32_t) == -can't open device TEST_DIR/empty.bochs: Catalog size is too large +qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too large == Too small catalog bitmap for image size == -can't open device TEST_DIR/empty.bochs: Catalog size is too small for this disk size -can't open device TEST_DIR/empty.bochs: Catalog size is too small for this disk size +qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too small for this disk size +qemu-io: can't open device TEST_DIR/empty.bochs: Catalog size is too small for this disk size == Negative extent size == -can't open device TEST_DIR/empty.bochs: Extent size 2147483648 is too large +qemu-io: can't open device TEST_DIR/empty.bochs: Extent size 2147483648 is too large == Zero extent size == -can't open device TEST_DIR/empty.bochs: Extent size must be at least 512 +qemu-io: can't open device TEST_DIR/empty.bochs: Extent size must be at least 512 *** done diff --git a/tests/qemu-iotests/080.out b/tests/qemu-iotests/080.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/080.out +++ b/tests/qemu-iotests/080.out @@ -XXX,XX +XXX,XX @@ QA output created by 080 == Huge header size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: qcow2 header exceeds cluster size -can't open device TEST_DIR/t.qcow2: qcow2 header exceeds cluster size +qemu-io: can't open device TEST_DIR/t.qcow2: qcow2 header exceeds cluster size +qemu-io: can't open device TEST_DIR/t.qcow2: qcow2 header exceeds cluster size == Huge unknown header extension == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: Invalid backing file offset -can't open device TEST_DIR/t.qcow2: Header extension too large -can't open device TEST_DIR/t.qcow2: Header extension too large +qemu-io: can't open device TEST_DIR/t.qcow2: Invalid backing file offset +qemu-io: can't open device TEST_DIR/t.qcow2: Header extension too large +qemu-io: can't open device TEST_DIR/t.qcow2: Header extension too large == Huge refcount table size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: Reference count table too large -can't open device TEST_DIR/t.qcow2: Reference count table too large +qemu-io: can't open device TEST_DIR/t.qcow2: Reference count table too large +qemu-io: can't open device TEST_DIR/t.qcow2: Reference count table too large == Misaligned refcount table == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: Reference count table offset invalid +qemu-io: can't open device TEST_DIR/t.qcow2: Reference count table offset invalid == Huge refcount offset == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: Reference count table offset invalid +qemu-io: can't open device TEST_DIR/t.qcow2: Reference count table offset invalid == Invalid snapshot table == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: Snapshot table too large -can't open device TEST_DIR/t.qcow2: Snapshot table too large -can't open device TEST_DIR/t.qcow2: Snapshot table offset invalid -can't open device TEST_DIR/t.qcow2: Snapshot table offset invalid +qemu-io: can't open device TEST_DIR/t.qcow2: Snapshot table too large +qemu-io: can't open device TEST_DIR/t.qcow2: Snapshot table too large +qemu-io: can't open device TEST_DIR/t.qcow2: Snapshot table offset invalid +qemu-io: can't open device TEST_DIR/t.qcow2: Snapshot table offset invalid == Hitting snapshot table size limit == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 @@ -XXX,XX +XXX,XX @@ read 512/512 bytes at offset 0 == Invalid L1 table == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: Active L1 table too large -can't open device TEST_DIR/t.qcow2: Active L1 table too large -can't open device TEST_DIR/t.qcow2: Active L1 table offset invalid -can't open device TEST_DIR/t.qcow2: Active L1 table offset invalid +qemu-io: can't open device TEST_DIR/t.qcow2: Active L1 table too large +qemu-io: can't open device TEST_DIR/t.qcow2: Active L1 table too large +qemu-io: can't open device TEST_DIR/t.qcow2: Active L1 table offset invalid +qemu-io: can't open device TEST_DIR/t.qcow2: Active L1 table offset invalid == Invalid L1 table (with internal snapshot in the image) == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 @@ -XXX,XX +XXX,XX @@ qemu-img: Could not open 'TEST_DIR/t.IMGFMT': L1 table is too small == Invalid backing file size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: Backing file name too long +qemu-io: can't open device TEST_DIR/t.qcow2: Backing file name too long == Invalid L2 entry (huge physical offset) == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 @@ -XXX,XX +XXX,XX @@ wrote 512/512 bytes at offset 0 qemu-img: Failed to load snapshot: Snapshot L1 table offset invalid qemu-img: Snapshot L1 table offset invalid qemu-img: Failed to turn zero into data clusters: Invalid argument -Failed to flush the refcount block cache: Invalid argument +qemu-io: Failed to flush the refcount block cache: Invalid argument write failed: Invalid argument qemu-img: Snapshot L1 table offset invalid qemu-img: Could not apply snapshot 'test': Failed to load snapshot: Invalid argument @@ -XXX,XX +XXX,XX @@ wrote 512/512 bytes at offset 0 qemu-img: Failed to load snapshot: Snapshot L1 table too large qemu-img: Snapshot L1 table too large qemu-img: Failed to turn zero into data clusters: File too large -Failed to flush the refcount block cache: File too large +qemu-io: Failed to flush the refcount block cache: File too large write failed: File too large qemu-img: Snapshot L1 table too large qemu-img: Could not apply snapshot 'test': Failed to load snapshot: File too large diff --git a/tests/qemu-iotests/081.out b/tests/qemu-iotests/081.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/081.out +++ b/tests/qemu-iotests/081.out @@ -XXX,XX +XXX,XX @@ read 10485760/10485760 bytes at offset 0 10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) == checking the blkverify mode with invalid settings == -can't open: blkverify=on can only be set if there are exactly two files and vote-threshold is 2 +qemu-io: can't open: blkverify=on can only be set if there are exactly two files and vote-threshold is 2 == dynamically adding a child to a quorum == Testing: diff --git a/tests/qemu-iotests/088.out b/tests/qemu-iotests/088.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/088.out +++ b/tests/qemu-iotests/088.out @@ -XXX,XX +XXX,XX @@ QA output created by 088 == Invalid block size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.vpc: Invalid block size 0 -can't open device TEST_DIR/t.vpc: Invalid block size 0 -can't open device TEST_DIR/t.vpc: Invalid block size 128 -can't open device TEST_DIR/t.vpc: Invalid block size 128 -can't open device TEST_DIR/t.vpc: Invalid block size 305419896 -can't open device TEST_DIR/t.vpc: Invalid block size 305419896 +qemu-io: can't open device TEST_DIR/t.vpc: Invalid block size 0 +qemu-io: can't open device TEST_DIR/t.vpc: Invalid block size 0 +qemu-io: can't open device TEST_DIR/t.vpc: Invalid block size 128 +qemu-io: can't open device TEST_DIR/t.vpc: Invalid block size 128 +qemu-io: can't open device TEST_DIR/t.vpc: Invalid block size 305419896 +qemu-io: can't open device TEST_DIR/t.vpc: Invalid block size 305419896 *** done diff --git a/tests/qemu-iotests/103.out b/tests/qemu-iotests/103.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/103.out +++ b/tests/qemu-iotests/103.out @@ -XXX,XX +XXX,XX @@ wrote 65536/65536 bytes at offset 0 === Testing invalid option combinations === -can't open device TEST_DIR/t.IMGFMT: cache-size, l2-cache-size and refcount-cache-size may not be set at the same time -can't open device TEST_DIR/t.IMGFMT: l2-cache-size may not exceed cache-size -can't open device TEST_DIR/t.IMGFMT: refcount-cache-size may not exceed cache-size -can't open device TEST_DIR/t.IMGFMT: cache-size, l2-cache-size and refcount-cache-size may not be set at the same time -can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536) -can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536) -can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536) +qemu-io: can't open device TEST_DIR/t.IMGFMT: cache-size, l2-cache-size and refcount-cache-size may not be set at the same time +qemu-io: can't open device TEST_DIR/t.IMGFMT: l2-cache-size may not exceed cache-size +qemu-io: can't open device TEST_DIR/t.IMGFMT: refcount-cache-size may not exceed cache-size +qemu-io: can't open device TEST_DIR/t.IMGFMT: cache-size, l2-cache-size and refcount-cache-size may not be set at the same time +qemu-io: can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536) +qemu-io: can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536) +qemu-io: can't open device TEST_DIR/t.IMGFMT: L2 cache entry size must be a power of two between 512 and the cluster size (65536) === Testing valid option combinations === diff --git a/tests/qemu-iotests/114.out b/tests/qemu-iotests/114.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/114.out +++ b/tests/qemu-iotests/114.out @@ -XXX,XX +XXX,XX @@ virtual size: 64M (67108864 bytes) cluster_size: 65536 backing file: TEST_DIR/t.IMGFMT.base backing file format: foo -can't open device TEST_DIR/t.qcow2: Could not open backing file: Unknown driver 'foo' +qemu-io: can't open device TEST_DIR/t.qcow2: Could not open backing file: Unknown driver 'foo' no file open, try 'help open' read 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) diff --git a/tests/qemu-iotests/116.out b/tests/qemu-iotests/116.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/116.out +++ b/tests/qemu-iotests/116.out @@ -XXX,XX +XXX,XX @@ QA output created by 116 == truncated header cluster == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 -can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument == invalid header magic == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 -can't open device TEST_DIR/t.qed: Image not in QED format +qemu-io: can't open device TEST_DIR/t.qed: Image not in QED format == invalid cluster size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 -can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument == invalid table size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 -can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument == invalid header size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 -can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument == invalid L1 table offset == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 -can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument == invalid image size == Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 -can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed': Invalid argument *** done diff --git a/tests/qemu-iotests/131.out b/tests/qemu-iotests/131.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/131.out +++ b/tests/qemu-iotests/131.out @@ -XXX,XX +XXX,XX @@ read 32768/32768 bytes at offset 163840 read 32768/32768 bytes at offset 0 32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) == Corrupt image == -can't open device TEST_DIR/t.parallels: parallels: Image was not closed correctly; cannot be opened read/write +qemu-io: can't open device TEST_DIR/t.parallels: parallels: Image was not closed correctly; cannot be opened read/write ERROR image was not closed correctly 1 errors were found on the image. diff --git a/tests/qemu-iotests/133.out b/tests/qemu-iotests/133.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/133.out +++ b/tests/qemu-iotests/133.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t === Check that node-name can't be changed === -Cannot change the option 'node-name' -Cannot change the option 'node-name' -Cannot change the option 'node-name' +qemu-io: Cannot change the option 'node-name' +qemu-io: Cannot change the option 'node-name' +qemu-io: Cannot change the option 'node-name' === Check that unchanged node-name is okay === === Check that driver can't be changed === -Cannot change the option 'driver' -Cannot change the option 'driver' -Cannot change the option 'driver' +qemu-io: Cannot change the option 'driver' +qemu-io: Cannot change the option 'driver' +qemu-io: Cannot change the option 'driver' === Check that unchanged driver is okay === @@ -XXX,XX +XXX,XX @@ format name: null-co === Check that mixing -c/-r/-w and their corresponding options is forbidden === -Cannot set both -r/-w and 'read-only' -Cannot set both -r/-w and 'read-only' -Cannot set both -c and the cache options -Cannot set both -c and the cache options -Cannot set both -c and the cache options +qemu-io: Cannot set both -r/-w and 'read-only' +qemu-io: Cannot set both -r/-w and 'read-only' +qemu-io: Cannot set both -c and the cache options +qemu-io: Cannot set both -c and the cache options +qemu-io: Cannot set both -c and the cache options === Check that invalid options are handled correctly === -Parameter 'read-only' expects 'on' or 'off' -Parameter 'cache.no-flush' expects 'on' or 'off' -Parameter 'cache.direct' expects 'on' or 'off' -Parameter 'auto-read-only' expects 'on' or 'off' +qemu-io: Parameter 'read-only' expects 'on' or 'off' +qemu-io: Parameter 'cache.no-flush' expects 'on' or 'off' +qemu-io: Parameter 'cache.direct' expects 'on' or 'off' +qemu-io: Parameter 'auto-read-only' expects 'on' or 'off' *** done diff --git a/tests/qemu-iotests/137.out b/tests/qemu-iotests/137.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/137.out +++ b/tests/qemu-iotests/137.out @@ -XXX,XX +XXX,XX @@ read 33554432/33554432 bytes at offset 0 === Try setting some invalid values === -Parameter 'lazy-refcounts' expects 'on' or 'off' -cache-size, l2-cache-size and refcount-cache-size may not be set at the same time -l2-cache-size may not exceed cache-size -refcount-cache-size may not exceed cache-size -L2 cache entry size must be a power of two between 512 and the cluster size (65536) -L2 cache entry size must be a power of two between 512 and the cluster size (65536) -Refcount cache size too big -Conflicting values for qcow2 options 'overlap-check' ('constant') and 'overlap-check.template' ('all') -Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all -Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all -Cache clean interval too big +qemu-io: Parameter 'lazy-refcounts' expects 'on' or 'off' +qemu-io: cache-size, l2-cache-size and refcount-cache-size may not be set at the same time +qemu-io: l2-cache-size may not exceed cache-size +qemu-io: refcount-cache-size may not exceed cache-size +qemu-io: L2 cache entry size must be a power of two between 512 and the cluster size (65536) +qemu-io: L2 cache entry size must be a power of two between 512 and the cluster size (65536) +qemu-io: Refcount cache size too big +qemu-io: Conflicting values for qcow2 options 'overlap-check' ('constant') and 'overlap-check.template' ('all') +qemu-io: Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all +qemu-io: Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all +qemu-io: Cache clean interval too big Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=36028797018963968 -L2 cache size too big +qemu-io: L2 cache size too big Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 === Test transaction semantics === -Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all +qemu-io: Unsupported value 'blubb' for qcow2 option 'overlap-check'. Allowed are any of the following: none, constant, cached, all wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ./common.rc: Killed ( if [ "${VALGRIND_QEMU}" == "y" ]; then @@ -XXX,XX +XXX,XX @@ incompatible_features 0x0 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Parameter 'lazy-refcounts' expects 'on' or 'off' +qemu-io: Parameter 'lazy-refcounts' expects 'on' or 'off' qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with qcow2_header); further corruption events will be suppressed write failed: Input/output error *** done diff --git a/tests/qemu-iotests/140.out b/tests/qemu-iotests/140.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/140.out +++ b/tests/qemu-iotests/140.out @@ -XXX,XX +XXX,XX @@ wrote 65536/65536 bytes at offset 0 read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": {}} -can't open device nbd+unix:///drv?socket=TEST_DIR/nbd: Requested export not available +qemu-io: can't open device nbd+unix:///drv?socket=TEST_DIR/nbd: Requested export not available server reported: export 'drv' not present {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} diff --git a/tests/qemu-iotests/143.out b/tests/qemu-iotests/143.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/143.out +++ b/tests/qemu-iotests/143.out @@ -XXX,XX +XXX,XX @@ QA output created by 143 {"return": {}} {"return": {}} -can't open device nbd+unix:///no_such_export?socket=TEST_DIR/nbd: Requested export not available +qemu-io: can't open device nbd+unix:///no_such_export?socket=TEST_DIR/nbd: Requested export not available server reported: export 'no_such_export' not present {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/153.out +++ b/tests/qemu-iotests/153.out @@ -XXX,XX +XXX,XX @@ Is another process using the image [TEST_DIR/t.qcow2]? == Running utility commands == _qemu_io_wrapper -c read 0 512 TEST_DIR/t.qcow2 -can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock Is another process using the image [TEST_DIR/t.qcow2]? _qemu_io_wrapper -r -c read 0 512 TEST_DIR/t.qcow2 -can't open device TEST_DIR/t.qcow2: Failed to get shared "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get shared "write" lock Is another process using the image [TEST_DIR/t.qcow2]? _qemu_io_wrapper -c open TEST_DIR/t.qcow2 -c read 0 512 -can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock Is another process using the image [TEST_DIR/t.qcow2]? no file open, try 'help open' _qemu_io_wrapper -c open -r TEST_DIR/t.qcow2 -c read 0 512 -can't open device TEST_DIR/t.qcow2: Failed to get shared "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get shared "write" lock Is another process using the image [TEST_DIR/t.qcow2]? no file open, try 'help open' @@ -XXX,XX +XXX,XX @@ file format: IMGFMT == Running utility commands -U == _qemu_io_wrapper -U -c read 0 512 TEST_DIR/t.qcow2 -can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images +qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images _qemu_io_wrapper -U -r -c read 0 512 TEST_DIR/t.qcow2 _qemu_io_wrapper -c open -U TEST_DIR/t.qcow2 -c read 0 512 -can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images +qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images no file open, try 'help open' _qemu_io_wrapper -c open -r -U TEST_DIR/t.qcow2 -c read 0 512 @@ -XXX,XX +XXX,XX @@ Is another process using the image [TEST_DIR/t.qcow2]? == Running utility commands == _qemu_io_wrapper -c read 0 512 TEST_DIR/t.qcow2 -can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock Is another process using the image [TEST_DIR/t.qcow2]? _qemu_io_wrapper -r -c read 0 512 TEST_DIR/t.qcow2 _qemu_io_wrapper -c open TEST_DIR/t.qcow2 -c read 0 512 -can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock Is another process using the image [TEST_DIR/t.qcow2]? no file open, try 'help open' @@ -XXX,XX +XXX,XX @@ file format: IMGFMT == Running utility commands -U == _qemu_io_wrapper -U -c read 0 512 TEST_DIR/t.qcow2 -can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images +qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images _qemu_io_wrapper -U -r -c read 0 512 TEST_DIR/t.qcow2 _qemu_io_wrapper -c open -U TEST_DIR/t.qcow2 -c read 0 512 -can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images +qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images no file open, try 'help open' _qemu_io_wrapper -c open -r -U TEST_DIR/t.qcow2 -c read 0 512 @@ -XXX,XX +XXX,XX @@ file format: IMGFMT == Running utility commands -U == _qemu_io_wrapper -U -c read 0 512 TEST_DIR/t.qcow2 -can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images +qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images _qemu_io_wrapper -U -r -c read 0 512 TEST_DIR/t.qcow2 _qemu_io_wrapper -c open -U TEST_DIR/t.qcow2 -c read 0 512 -can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images +qemu-io: can't open device TEST_DIR/t.qcow2: force-share=on can only be used with read-only images no file open, try 'help open' _qemu_io_wrapper -c open -r -U TEST_DIR/t.qcow2 -c read 0 512 @@ -XXX,XX +XXX,XX @@ Adding drive {"return": "OKrn"} _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 -can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock Is another process using the image [TEST_DIR/t.qcow2]? Creating overlay with qemu-img when the guest is running should be allowed @@ -XXX,XX +XXX,XX @@ _qemu_img_wrapper info TEST_DIR/t.qcow2 {"return": ""} _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 -can't open device TEST_DIR/t.qcow2: Failed to get "write" lock +qemu-io: can't open device TEST_DIR/t.qcow2: Failed to get "write" lock Is another process using the image [TEST_DIR/t.qcow2]? Closing the other {"return": ""} @@ -XXX,XX +XXX,XX @@ qemu-img: --force-share/-U conflicts with image options No conflict: Conflict: --U conflicts with image options +qemu-io: -U conflicts with image options *** done diff --git a/tests/qemu-iotests/187.out b/tests/qemu-iotests/187.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/187.out +++ b/tests/qemu-iotests/187.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 Start from read-only -Block node is read-only +qemu-io: Block node is read-only wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Block node is read-only +qemu-io: Block node is read-only Start from read-write wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -Block node is read-only +qemu-io: Block node is read-only wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) *** done diff --git a/tests/qemu-iotests/188.out b/tests/qemu-iotests/188.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/188.out +++ b/tests/qemu-iotests/188.out @@ -XXX,XX +XXX,XX @@ read 16777216/16777216 bytes at offset 0 16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) == verify open failure with wrong password == -can't open: Invalid password, cannot unlock any keyslot +qemu-io: can't open: Invalid password, cannot unlock any keyslot *** done diff --git a/tests/qemu-iotests/197.out b/tests/qemu-iotests/197.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/197.out +++ b/tests/qemu-iotests/197.out @@ -XXX,XX +XXX,XX @@ read 2147483136/2147483136 bytes at offset 1024 2 GiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 1024/1024 bytes at offset 3221226496 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -can't open device TEST_DIR/t.wrap.qcow2: Can't use copy-on-read on read-only device +qemu-io: can't open device TEST_DIR/t.wrap.qcow2: Can't use copy-on-read on read-only device 2 GiB (0x80010000) bytes allocated at offset 0 bytes (0x0) 1023.938 MiB (0x3fff0000) bytes not allocated at offset 2 GiB (0x80010000) 64 KiB (0x10000) bytes allocated at offset 3 GiB (0xc0000000) diff --git a/tests/qemu-iotests/205 b/tests/qemu-iotests/205 index XXXXXXX..XXXXXXX 100755 --- a/tests/qemu-iotests/205 +++ b/tests/qemu-iotests/205 @@ -XXX,XX +XXX,XX @@ class TestNbdServerRemove(iotests.QMPTestCase): def assertConnectFailed(self, qemu_io_output): self.assertEqual(filter_qemu_io(qemu_io_output).strip(), - "can't open device " + nbd_uri + + "qemu-io: can't open device " + nbd_uri + ": Requested export not available\n" "server reported: export 'exp' not present") diff --git a/tests/qemu-iotests/215.out b/tests/qemu-iotests/215.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/215.out +++ b/tests/qemu-iotests/215.out @@ -XXX,XX +XXX,XX @@ read 2147483136/2147483136 bytes at offset 1024 2 GiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 1024/1024 bytes at offset 3221226496 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -can't open device TEST_DIR/t.wrap.qcow2: Block node is read-only +qemu-io: can't open device TEST_DIR/t.wrap.qcow2: Block node is read-only 2 GiB (0x80010000) bytes allocated at offset 0 bytes (0x0) 1023.938 MiB (0x3fff0000) bytes not allocated at offset 2 GiB (0x80010000) 64 KiB (0x10000) bytes allocated at offset 3 GiB (0xc0000000) diff --git a/tests/qemu-iotests/226.out b/tests/qemu-iotests/226.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/226.out +++ b/tests/qemu-iotests/226.out @@ -XXX,XX +XXX,XX @@ QA output created by 226 === Testing with driver:file === == Testing RO == -can't open: A regular file was expected by the 'file' driver, but something else was given -warning: Opening a character device as a file using the 'file' driver is deprecated +qemu-io: can't open: A regular file was expected by the 'file' driver, but something else was given +qemu-io: warning: Opening a character device as a file using the 'file' driver is deprecated == Testing RW == -can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory -warning: Opening a character device as a file using the 'file' driver is deprecated +qemu-io: can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory +qemu-io: warning: Opening a character device as a file using the 'file' driver is deprecated === Testing with driver:host_device === == Testing RO == -can't open: 'host_device' driver expects either a character or block device +qemu-io: can't open: 'host_device' driver expects either a character or block device == Testing RW == -can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory +qemu-io: can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory === Testing with driver:host_cdrom === == Testing RO == -can't open: 'host_cdrom' driver expects either a character or block device +qemu-io: can't open: 'host_cdrom' driver expects either a character or block device == Testing RW == -can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory +qemu-io: can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory *** done diff --git a/tests/qemu-iotests/244.out b/tests/qemu-iotests/244.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/244.out +++ b/tests/qemu-iotests/244.out @@ -XXX,XX +XXX,XX @@ read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory +qemu-io: can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory no file open, try 'help open' Data file required, but without data file name in the image: -can't open device TEST_DIR/t.qcow2: 'data-file' is required for this image +qemu-io: can't open device TEST_DIR/t.qcow2: 'data-file' is required for this image no file open, try 'help open' read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory +qemu-io: can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory no file open, try 'help open' Setting data-file for an image with internal data: Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 -can't open device TEST_DIR/t.qcow2: 'data-file' can only be set for images with an external data file +qemu-io: can't open device TEST_DIR/t.qcow2: 'data-file' can only be set for images with an external data file no file open, try 'help open' -can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory +qemu-io: can't open device TEST_DIR/t.qcow2: Could not open 'inexistent': No such file or directory no file open, try 'help open' === Conflicting features === -- 2.20.1
Even for block nodes with bs->drv == NULL, we can't just ignore a bdrv_set_aio_context() call. Leaving the node in its old context can mean that it's still in an iothread context in bdrv_close_all() during shutdown, resulting in an attempted unlock of the AioContext lock which we don't hold. This is an example stack trace of a related crash: #0 0x00007ffff59da57f in raise () at /lib64/libc.so.6 #1 0x00007ffff59c4895 in abort () at /lib64/libc.so.6 #2 0x0000555555b97b1e in error_exit (err=<optimized out>, msg=msg@entry=0x555555d386d0 <__func__.19059> "qemu_mutex_unlock_impl") at util/qemu-thread-posix.c:36 #3 0x0000555555b97f7f in qemu_mutex_unlock_impl (mutex=mutex@entry=0x5555568002f0, file=file@entry=0x555555d378df "util/async.c", line=line@entry=507) at util/qemu-thread-posix.c:97 #4 0x0000555555b92f55 in aio_context_release (ctx=ctx@entry=0x555556800290) at util/async.c:507 #5 0x0000555555b05cf8 in bdrv_prwv_co (child=child@entry=0x7fffc80012f0, offset=offset@entry=131072, qiov=qiov@entry=0x7fffffffd4f0, is_write=is_write@entry=true, flags=flags@entry=0) at block/io.c:833 #6 0x0000555555b060a9 in bdrv_pwritev (qiov=0x7fffffffd4f0, offset=131072, child=0x7fffc80012f0) at block/io.c:990 #7 0x0000555555b060a9 in bdrv_pwrite (child=0x7fffc80012f0, offset=131072, buf=<optimized out>, bytes=<optimized out>) at block/io.c:990 #8 0x0000555555ae172b in qcow2_cache_entry_flush (bs=bs@entry=0x555556810680, c=c@entry=0x5555568cc740, i=i@entry=0) at block/qcow2-cache.c:51 #9 0x0000555555ae18dd in qcow2_cache_write (bs=bs@entry=0x555556810680, c=0x5555568cc740) at block/qcow2-cache.c:248 #10 0x0000555555ae15de in qcow2_cache_flush (bs=0x555556810680, c=<optimized out>) at block/qcow2-cache.c:259 #11 0x0000555555ae16b1 in qcow2_cache_flush_dependency (c=0x5555568a1700, c=0x5555568a1700, bs=0x555556810680) at block/qcow2-cache.c:194 #12 0x0000555555ae16b1 in qcow2_cache_entry_flush (bs=bs@entry=0x555556810680, c=c@entry=0x5555568a1700, i=i@entry=0) at block/qcow2-cache.c:194 #13 0x0000555555ae18dd in qcow2_cache_write (bs=bs@entry=0x555556810680, c=0x5555568a1700) at block/qcow2-cache.c:248 #14 0x0000555555ae15de in qcow2_cache_flush (bs=bs@entry=0x555556810680, c=<optimized out>) at block/qcow2-cache.c:259 #15 0x0000555555ad242c in qcow2_inactivate (bs=bs@entry=0x555556810680) at block/qcow2.c:2124 #16 0x0000555555ad2590 in qcow2_close (bs=0x555556810680) at block/qcow2.c:2153 #17 0x0000555555ab0c62 in bdrv_close (bs=0x555556810680) at block.c:3358 #18 0x0000555555ab0c62 in bdrv_delete (bs=0x555556810680) at block.c:3542 #19 0x0000555555ab0c62 in bdrv_unref (bs=0x555556810680) at block.c:4598 #20 0x0000555555af4d72 in blk_remove_bs (blk=blk@entry=0x5555568103d0) at block/block-backend.c:785 #21 0x0000555555af4dbb in blk_remove_all_bs () at block/block-backend.c:483 #22 0x0000555555aae02f in bdrv_close_all () at block.c:3412 #23 0x00005555557f9796 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4776 The reproducer I used is a qcow2 image on gluster volume, where the virtual disk size (4 GB) is larger than the gluster volume size (64M), so we can easily trigger an ENOSPC. This backend is assigned to a virtio-blk device using an iothread, and then from the guest a 'dd if=/dev/zero of=/dev/vda bs=1G count=1' causes the VM to stop because of an I/O error. qemu_gluster_co_flush_to_disk() sets bs->drv = NULL on error, so when virtio-blk stops the dataplane, the block nodes stay in the iothread AioContext. A 'quit' monitor command issued from this paused state crashes the process. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1631227 Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> --- block.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/block.c b/block.c index XXXXXXX..XXXXXXX 100644 --- a/block.c +++ b/block.c @@ -XXX,XX +XXX,XX @@ void bdrv_detach_aio_context(BlockDriverState *bs) BdrvAioNotifier *baf, *baf_tmp; BdrvChild *child; - if (!bs->drv) { - return; - } - assert(!bs->walking_aio_notifiers); bs->walking_aio_notifiers = true; QLIST_FOREACH_SAFE(baf, &bs->aio_notifiers, list, baf_tmp) { @@ -XXX,XX +XXX,XX @@ void bdrv_detach_aio_context(BlockDriverState *bs) */ bs->walking_aio_notifiers = false; - if (bs->drv->bdrv_detach_aio_context) { + if (bs->drv && bs->drv->bdrv_detach_aio_context) { bs->drv->bdrv_detach_aio_context(bs); } QLIST_FOREACH(child, &bs->children, next) { @@ -XXX,XX +XXX,XX @@ void bdrv_attach_aio_context(BlockDriverState *bs, BdrvAioNotifier *ban, *ban_tmp; BdrvChild *child; - if (!bs->drv) { - return; - } - if (bs->quiesce_counter) { aio_disable_external(new_context); } @@ -XXX,XX +XXX,XX @@ void bdrv_attach_aio_context(BlockDriverState *bs, QLIST_FOREACH(child, &bs->children, next) { bdrv_attach_aio_context(child->bs, new_context); } - if (bs->drv->bdrv_attach_aio_context) { + if (bs->drv && bs->drv->bdrv_attach_aio_context) { bs->drv->bdrv_attach_aio_context(bs, new_context); } -- 2.20.1
From: Zhengui li <lizhengui@huawei.com> Concurrent IO becomes serial IO because of the qemu Coroutine lock, which reduce IO performance severely. So unlock Coroutine lock before bdrv_co_pwritev and bdrv_co_preadv to fix it. Signed-off-by: Zhengui li <lizhengui@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/vpc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index XXXXXXX..XXXXXXX 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -XXX,XX +XXX,XX @@ vpc_co_preadv(BlockDriverState *bs, uint64_t offset, uint64_t bytes, qemu_iovec_reset(&local_qiov); qemu_iovec_concat(&local_qiov, qiov, bytes_done, n_bytes); + qemu_co_mutex_unlock(&s->lock); ret = bdrv_co_preadv(bs->file, image_offset, n_bytes, &local_qiov, 0); + qemu_co_mutex_lock(&s->lock); if (ret < 0) { goto fail; } @@ -XXX,XX +XXX,XX @@ vpc_co_pwritev(BlockDriverState *bs, uint64_t offset, uint64_t bytes, qemu_iovec_reset(&local_qiov); qemu_iovec_concat(&local_qiov, qiov, bytes_done, n_bytes); + qemu_co_mutex_unlock(&s->lock); ret = bdrv_co_pwritev(bs->file, image_offset, n_bytes, &local_qiov, 0); + qemu_co_mutex_lock(&s->lock); if (ret < 0) { goto fail; } -- 2.20.1
From: Sam Eiderman <shmuel.eiderman@oracle.com> Commit b69864e5a ("vmdk: Support version=3 in VMDK descriptor files") fixed the probe function to correctly guess vmdk descriptors with version=3. This solves the issue where vmdk snapshot with parent vmdk descriptor containing "version=3" would be treated as raw instead vmdk. In the future case where a new vmdk version is introduced, we will again experience this issue, even if the user will provide "-f vmdk" it will only apply to the tip image and not to the underlying "misprobed" parent image. The code in vmdk.c already assumes that the backing file of vmdk must be vmdk (see vmdk_is_cid_valid which returns 0 if backing file is not vmdk). So let's make it official by supplying the backing_format as vmdk. Reviewed-by: Mark Kanda <mark.kanda@oracle.com> Reviewed-By: Liran Alon <liran.alon@oracle.com> Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com> Signed-off-by: Shmuel Eiderman <shmuel.eiderman@oracle.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Fam Zheng <fam@euphon.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/vmdk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index XXXXXXX..XXXXXXX 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -XXX,XX +XXX,XX @@ static int vmdk_parent_open(BlockDriverState *bs) pstrcpy(bs->auto_backing_file, end_name - p_name + 1, p_name); pstrcpy(bs->backing_file, sizeof(bs->backing_file), bs->auto_backing_file); + pstrcpy(bs->backing_format, sizeof(bs->backing_format), + "vmdk"); } out: -- 2.20.1
From: Stefano Garzarella <sgarzare@redhat.com> IEC binary prefixes are already defined in "qemu/units.h", so we can remove redundant definitions in "block/vhdx.h". Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/vhdx.h | 6 +----- block/vhdx.c | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/block/vhdx.h b/block/vhdx.h index XXXXXXX..XXXXXXX 100644 --- a/block/vhdx.h +++ b/block/vhdx.h @@ -XXX,XX +XXX,XX @@ #ifndef BLOCK_VHDX_H #define BLOCK_VHDX_H - -#define KiB (1 * 1024) -#define MiB (KiB * 1024) -#define GiB (MiB * 1024) -#define TiB ((uint64_t) GiB * 1024) +#include "qemu/units.h" #define DEFAULT_LOG_SIZE 1048576 /* 1MiB */ /* Structures and fields present in the VHDX file */ diff --git a/block/vhdx.c b/block/vhdx.c index XXXXXXX..XXXXXXX 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -XXX,XX +XXX,XX @@ static int coroutine_fn vhdx_co_create(BlockdevCreateOptions *opts, return -EINVAL; } if (block_size > VHDX_BLOCK_SIZE_MAX) { - error_setg(errp, "Block size must not exceed %d", VHDX_BLOCK_SIZE_MAX); + error_setg(errp, "Block size must not exceed %" PRId64, + VHDX_BLOCK_SIZE_MAX); return -EINVAL; } -- 2.20.1
From: Stefano Garzarella <sgarzare@redhat.com> Using IEC binary prefixes in order to make the code more readable, with the exception of DEFAULT_LOG_SIZE because it's passed to stringify(). Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/vhdx.h | 10 ++++++---- block/vhdx-log.c | 2 +- block/vhdx.c | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/block/vhdx.h b/block/vhdx.h index XXXXXXX..XXXXXXX 100644 --- a/block/vhdx.h +++ b/block/vhdx.h @@ -XXX,XX +XXX,XX @@ #include "qemu/units.h" #define DEFAULT_LOG_SIZE 1048576 /* 1MiB */ +/* Note: can't use 1 * MiB, because it's passed to stringify() */ + /* Structures and fields present in the VHDX file */ /* The header section has the following blocks, @@ -XXX,XX +XXX,XX @@ * 0.........64KB...........128KB........192KB..........256KB................1MB */ -#define VHDX_HEADER_BLOCK_SIZE (64 * 1024) +#define VHDX_HEADER_BLOCK_SIZE (64 * KiB) #define VHDX_FILE_ID_OFFSET 0 #define VHDX_HEADER1_OFFSET (VHDX_HEADER_BLOCK_SIZE * 1) @@ -XXX,XX +XXX,XX @@ typedef struct QEMU_PACKED MSGUID { #define guid_eq(a, b) \ (memcmp(&(a), &(b), sizeof(MSGUID)) == 0) -#define VHDX_HEADER_SIZE (4 * 1024) /* although the vhdx_header struct in disk +#define VHDX_HEADER_SIZE (4 * KiB) /* although the vhdx_header struct in disk is only 582 bytes, for purposes of crc the header is the first 4KB of the 64KB block */ @@ -XXX,XX +XXX,XX @@ typedef struct QEMU_PACKED VHDXRegionTableEntry { /* ---- LOG ENTRY STRUCTURES ---- */ -#define VHDX_LOG_MIN_SIZE (1024 * 1024) -#define VHDX_LOG_SECTOR_SIZE 4096 +#define VHDX_LOG_MIN_SIZE (1 * MiB) +#define VHDX_LOG_SECTOR_SIZE (4 * KiB) #define VHDX_LOG_HDR_SIZE 64 #define VHDX_LOG_SIGNATURE 0x65676f6c typedef struct QEMU_PACKED VHDXLogEntryHeader { diff --git a/block/vhdx-log.c b/block/vhdx-log.c index XXXXXXX..XXXXXXX 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -XXX,XX +XXX,XX @@ static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s, } if (file_length < desc_entries->hdr.last_file_offset) { new_file_size = desc_entries->hdr.last_file_offset; - if (new_file_size % (1024*1024)) { + if (new_file_size % (1 * MiB)) { /* round up to nearest 1MB boundary */ new_file_size = QEMU_ALIGN_UP(new_file_size, MiB); if (new_file_size > INT64_MAX) { diff --git a/block/vhdx.c b/block/vhdx.c index XXXXXXX..XXXXXXX 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -XXX,XX +XXX,XX @@ static int vhdx_allocate_block(BlockDriverState *bs, BDRVVHDXState *s, *new_offset = current_len; /* per the spec, the address for a block is in units of 1MB */ - *new_offset = ROUND_UP(*new_offset, 1024 * 1024); + *new_offset = ROUND_UP(*new_offset, 1 * MiB); if (*new_offset > INT64_MAX) { return -EINVAL; } @@ -XXX,XX +XXX,XX @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, case PAYLOAD_BLOCK_FULLY_PRESENT: /* if the file offset address is in the header zone, * there is a problem */ - if (sinfo.file_offset < (1024 * 1024)) { + if (sinfo.file_offset < (1 * MiB)) { ret = -EFAULT; goto error_bat_restore; } -- 2.20.1
From: Eric Blake <eblake@redhat.com> When extracting a human-readable size formatter, we changed 'uint64_t div' pre-patch to 'unsigned long div' post-patch. Which breaks on 32-bit platforms, resulting in 'inf' instead of intended values larger than 999GB. Fixes: 22951aaa CC: qemu-stable@nongnu.org Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- util/cutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/cutils.c b/util/cutils.c index XXXXXXX..XXXXXXX 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -XXX,XX +XXX,XX @@ const char *qemu_ether_ntoa(const MACAddr *mac) char *size_to_str(uint64_t val) { static const char *suffixes[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei" }; - unsigned long div; + uint64_t div; int i; /* -- 2.20.1
From: Eric Blake <eblake@redhat.com> Disk sizes close to INT64_MAX cause overflow, for some pretty ridiculous output: $ ./nbdkit -U - memory size=$((2**63 - 512)) --run 'qemu-img info $nbd' image: nbd+unix://?socket=/tmp/nbdkitHSAzNz/socket file format: raw virtual size: -8388607T (9223372036854775296 bytes) disk size: unavailable But there's no reason to have two separate implementations of integer to human-readable abbreviation, where one has overflow and stops at 'T', while the other avoids overflow and goes all the way to 'E'. With this patch, the output now claims 8EiB instead of -8388607T, which really is the correct rounding of largest file size supported by qemu (we could go 511 bytes larger if we used byte-accurate sizing instead of rounding up to the next sector boundary, but that wouldn't change the human-readable result). Quite a few iotests need updates to expected output to match. Reported-by: Richard W.M. Jones <rjones@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Tested-by: Richard W.M. Jones <rjones@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Tested-by: Max Reitz <mreitz@redhat.com> --- block/qapi.c | 49 +++++++++----------------------------- tests/qemu-iotests/043.out | 6 ++--- tests/qemu-iotests/053.out | 2 +- tests/qemu-iotests/059.out | 10 ++++---- tests/qemu-iotests/060.out | 10 ++++---- tests/qemu-iotests/061.out | 12 +++++----- tests/qemu-iotests/070.out | 2 +- tests/qemu-iotests/082.out | 26 ++++++++++---------- tests/qemu-iotests/084.out | 8 +++---- tests/qemu-iotests/089.out | 2 +- tests/qemu-iotests/095.out | 4 ++-- tests/qemu-iotests/104.out | 6 ++--- tests/qemu-iotests/110.out | 6 ++--- tests/qemu-iotests/114.out | 2 +- tests/qemu-iotests/126.out | 4 ++-- tests/qemu-iotests/130.out | 10 ++++---- tests/qemu-iotests/153.out | 2 +- tests/qemu-iotests/191.out | 8 +++---- tests/qemu-iotests/195.out | 4 ++-- tests/qemu-iotests/198.out | 4 ++-- tests/qemu-iotests/206.out | 10 ++++---- tests/qemu-iotests/207.out | 12 +++++----- tests/qemu-iotests/210.out | 8 +++---- tests/qemu-iotests/211.out | 10 ++++---- tests/qemu-iotests/212.out | 10 ++++---- tests/qemu-iotests/213.out | 10 ++++---- tests/qemu-iotests/233.out | 4 ++-- tests/qemu-iotests/237.out | 22 ++++++++--------- tests/qemu-iotests/242.out | 10 ++++---- 29 files changed, 123 insertions(+), 150 deletions(-) diff --git a/block/qapi.c b/block/qapi.c index XXXXXXX..XXXXXXX 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -XXX,XX +XXX,XX @@ BlockStatsList *qmp_query_blockstats(bool has_query_nodes, return head; } -#define NB_SUFFIXES 4 - -static char *get_human_readable_size(char *buf, int buf_size, int64_t size) -{ - static const char suffixes[NB_SUFFIXES] = {'K', 'M', 'G', 'T'}; - int64_t base; - int i; - - if (size <= 999) { - snprintf(buf, buf_size, "%" PRId64, size); - } else { - base = 1024; - for (i = 0; i < NB_SUFFIXES; i++) { - if (size < (10 * base)) { - snprintf(buf, buf_size, "%0.1f%c", - (double)size / base, - suffixes[i]); - break; - } else if (size < (1000 * base) || i == (NB_SUFFIXES - 1)) { - snprintf(buf, buf_size, "%" PRId64 "%c", - ((size + (base >> 1)) / base), - suffixes[i]); - break; - } - base = base * 1024; - } - } - return buf; -} - void bdrv_snapshot_dump(QEMUSnapshotInfo *sn) { - char buf1[128], date_buf[128], clock_buf[128]; + char date_buf[128], clock_buf[128]; struct tm tm; time_t ti; int64_t secs; + char *sizing = NULL; if (!sn) { qemu_printf("%-10s%-20s%7s%20s%15s", @@ -XXX,XX +XXX,XX @@ void bdrv_snapshot_dump(QEMUSnapshotInfo *sn) (int)((secs / 60) % 60), (int)(secs % 60), (int)((sn->vm_clock_nsec / 1000000) % 1000)); + sizing = size_to_str(sn->vm_state_size); qemu_printf("%-10s%-20s%7s%20s%15s", sn->id_str, sn->name, - get_human_readable_size(buf1, sizeof(buf1), - sn->vm_state_size), + sizing, date_buf, clock_buf); } + g_free(sizing); } static void dump_qdict(int indentation, QDict *dict); @@ -XXX,XX +XXX,XX @@ void bdrv_image_info_specific_dump(ImageInfoSpecific *info_spec) void bdrv_image_info_dump(ImageInfo *info) { - char size_buf[128], dsize_buf[128]; + char *size_buf, *dsize_buf; if (!info->has_actual_size) { - snprintf(dsize_buf, sizeof(dsize_buf), "unavailable"); + dsize_buf = g_strdup("unavailable"); } else { - get_human_readable_size(dsize_buf, sizeof(dsize_buf), - info->actual_size); + dsize_buf = size_to_str(info->actual_size); } - get_human_readable_size(size_buf, sizeof(size_buf), info->virtual_size); + size_buf = size_to_str(info->virtual_size); qemu_printf("image: %s\n" "file format: %s\n" "virtual size: %s (%" PRId64 " bytes)\n" @@ -XXX,XX +XXX,XX @@ void bdrv_image_info_dump(ImageInfo *info) info->filename, info->format, size_buf, info->virtual_size, dsize_buf); + g_free(size_buf); + g_free(dsize_buf); if (info->has_encrypted && info->encrypted) { qemu_printf("encrypted: yes\n"); diff --git a/tests/qemu-iotests/043.out b/tests/qemu-iotests/043.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/043.out +++ b/tests/qemu-iotests/043.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/ == finite chain of length 3 (human) == image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 backing file: TEST_DIR/t.IMGFMT.2.base image: TEST_DIR/t.IMGFMT.2.base file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 backing file: TEST_DIR/t.IMGFMT.1.base image: TEST_DIR/t.IMGFMT.1.base file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 == finite chain of length 3 (json) == diff --git a/tests/qemu-iotests/053.out b/tests/qemu-iotests/053.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/053.out +++ b/tests/qemu-iotests/053.out @@ -XXX,XX +XXX,XX @@ wrote 512/512 bytes at offset 0 No errors were found on the image. == Checking compressed image virtual disk size == -virtual size: 512 (512 bytes) +virtual size: 512 B (512 bytes) == Verifying the compressed image == read 512/512 bytes at offset 0 diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -XXX,XX +XXX,XX @@ can't open device TEST_DIR/t.vmdk: L1 size too big Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648 subformat=monolithicFlat image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 2.0G (2147483648 bytes) +virtual size: 2 GiB (2147483648 bytes) === Testing monolithicFlat with zeroed_grain === qemu-img: TEST_DIR/t.IMGFMT: Flat image can't enable zeroed grain @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=2147483648 subformat=monolithicF Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824000 subformat=twoGbMaxExtentFlat image: TEST_DIR/t.vmdk file format: vmdk -virtual size: 1.0T (1073741824000 bytes) -disk size: 16K +virtual size: 0.977 TiB (1073741824000 bytes) +disk size: 16 KiB Format specific information: cid: XXXXXXXX parent cid: XXXXXXXX @@ -XXX,XX +XXX,XX @@ can't open: Cannot use relative extent paths with VMDK descriptor file 'json:{"i === Testing version 3 === image: TEST_DIR/iotest-version3.IMGFMT file format: IMGFMT -virtual size: 16G (17179869184 bytes) +virtual size: 16 GiB (17179869184 bytes) cluster_size: 65536 read 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -XXX,XX +XXX,XX @@ read 512/512 bytes at offset 64931328 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4398046511104 subformat=monolithicFlat image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 4.0T (4398046511104 bytes) +virtual size: 4 TiB (4398046511104 bytes) wrote 512/512 bytes at offset 966367641600 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) e100000000: 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a 0a ................ diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/060.out +++ b/tests/qemu-iotests/060.out @@ -XXX,XX +XXX,XX @@ write failed: Input/output error incompatible_features 0x2 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 qcow2: Marking image as corrupt: Refblock at 0xffffff00000000 is not covered by the refcount structures; further corruption events will be suppressed qemu-img: Failed to discard unused refblocks: Input/output error --- Checking and retrying --- -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) No errors were found on the image. Image resized. -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) === Discarding a non-covered in-bounds refblock === @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 qcow2: Marking image as corrupt: Refblock at 0x1000000000 is not covered by the refcount structures; further corruption events will be suppressed qemu-img: Failed to discard unused refblocks: Input/output error --- Checking and retrying --- -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) No errors were found on the image. Image resized. -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) === Discarding a refblock covered by an unaligned refblock === diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/061.out +++ b/tests/qemu-iotests/061.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 data_file=TEST_DIR/t.IM qemu-img: Cannot downgrade an image with a data file image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 data_file=TEST_DIR/t.IM qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Could not open 'foo': No such file or directory image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: qemu-img: Could not open 'TEST_DIR/t.IMGFMT': 'data-file' is required for this image image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 data_file=TEST_DIR/t.IMGFMT.data data_file_raw=on image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: No errors were found on the image. image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ No errors were found on the image. qemu-img: data-file-raw cannot be set on existing images image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 diff --git a/tests/qemu-iotests/070.out b/tests/qemu-iotests/070.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/070.out +++ b/tests/qemu-iotests/070.out @@ -XXX,XX +XXX,XX @@ read 18874368/18874368 bytes at offset 0 === Verify image created by Disk2VHD can be opened === image: TEST_DIR/test-disk2vhd.IMGFMT file format: IMGFMT -virtual size: 256M (268435456 bytes) +virtual size: 256 MiB (268435456 bytes) cluster_size: 2097152 *** done diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/082.out +++ b/tests/qemu-iotests/082.out @@ -XXX,XX +XXX,XX @@ Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_refcounts=off refcount_bits=16 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 128M Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=4096 lazy_refcounts=on refcount_bits=16 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 4096 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=on refcount_bits=16 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 8192 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Testing: create -f qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 128 Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=8192 lazy_refcounts=off refcount_bits=16 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 8192 === create: help for -o === @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 cluster_size=65536 lazy_ Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base image: TEST_DIR/t.IMGFMT.base file format: raw -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) Testing: convert -O foo -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base image: TEST_DIR/t.IMGFMT.base file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base image: TEST_DIR/t.IMGFMT.base file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 4096 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base image: TEST_DIR/t.IMGFMT.base file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 8192 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: Testing: convert -O qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base image: TEST_DIR/t.IMGFMT.base file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 8192 === convert: help for -o === @@ -XXX,XX +XXX,XX @@ qemu-img: Cannot enable copy offloading when -c is used Testing: amend -f foo -f qcow2 -o lazy_refcounts=on TEST_DIR/t.qcow2 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: Testing: amend -f qcow2 -o size=130M -o lazy_refcounts=off TEST_DIR/t.qcow2 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 130M (136314880 bytes) +virtual size: 130 MiB (136314880 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: Testing: amend -f qcow2 -o size=8M -o lazy_refcounts=on -o size=132M TEST_DIR/t.qcow2 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 132M (138412032 bytes) +virtual size: 132 MiB (138412032 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: Testing: amend -f qcow2 -o size=4M,size=148M TEST_DIR/t.qcow2 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 148M (155189248 bytes) +virtual size: 148 MiB (155189248 bytes) cluster_size: 65536 === amend: help for -o === diff --git a/tests/qemu-iotests/084.out b/tests/qemu-iotests/084.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/084.out +++ b/tests/qemu-iotests/084.out @@ -XXX,XX +XXX,XX @@ QA output created by 084 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 1048576 disk image file size in bytes: 67109888 @@ -XXX,XX +XXX,XX @@ disk image file size in bytes: 67109888 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 1048576 disk image file size in bytes: 1024 Test 1: Maximum size (512 TB - 128 MB): image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 512T (562949819203584 bytes) +virtual size: 512 TiB (562949819203584 bytes) cluster_size: 1048576 Test 2: Size too large (512 TB - 128 MB + 64 kB) @@ -XXX,XX +XXX,XX @@ qemu-img: Could not open 'TEST_DIR/t.IMGFMT': unsupported VDI image (too many bl Test 5: Valid Image: 64MB, Blocks In Image 64, Block Size 1MB image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 1048576 Test 6: Block Size != 1MB; too small test (1MB - 1) diff --git a/tests/qemu-iotests/089.out b/tests/qemu-iotests/089.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/089.out +++ b/tests/qemu-iotests/089.out @@ -XXX,XX +XXX,XX @@ read failed: Input/output error image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 === Testing option merging === diff --git a/tests/qemu-iotests/095.out b/tests/qemu-iotests/095.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/095.out +++ b/tests/qemu-iotests/095.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file=TEST_DIR/ === Base image info before commit and resize === image: TEST_DIR/t.IMGFMT.base file format: IMGFMT -virtual size: 5.0M (5242880 bytes) +virtual size: 5 MiB (5242880 bytes) === Running QEMU Live Commit Test === @@ -XXX,XX +XXX,XX @@ virtual size: 5.0M (5242880 bytes) === Base image info after commit and resize === image: TEST_DIR/t.IMGFMT.base file format: IMGFMT -virtual size: 100M (104857600 bytes) +virtual size: 100 MiB (104857600 bytes) *** done diff --git a/tests/qemu-iotests/104.out b/tests/qemu-iotests/104.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/104.out +++ b/tests/qemu-iotests/104.out @@ -XXX,XX +XXX,XX @@ QA output created by 104 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1024 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 1.0K (1024 bytes) +virtual size: 1 KiB (1024 bytes) Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1234 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 1.5K (1536 bytes) -***done +virtual size: 1.5 KiB (1536 bytes) +*** done diff --git a/tests/qemu-iotests/110.out b/tests/qemu-iotests/110.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/110.out +++ b/tests/qemu-iotests/110.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.base image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) backing file: t.IMGFMT.base (actual path: TEST_DIR/t.IMGFMT.base) === Non-reconstructable filename === image: json:{"driver": "IMGFMT", "file": {"set-state.0.event": "read_aio", "image": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, "driver": "blkdebug", "set-state.0.new_state": 42}} file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) backing file: t.IMGFMT.base (actual path: TEST_DIR/t.IMGFMT.base) === Backing name is always relative to the backed image === @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.b image: json:{"driver": "IMGFMT", "file": {"children": [{"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, {"driver": "file", "filename": "TEST_DIR/t.IMGFMT.copy"}], "driver": "quorum", "vote-threshold": 1}} file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) backing file: t.IMGFMT.base (cannot determine actual path) *** done diff --git a/tests/qemu-iotests/114.out b/tests/qemu-iotests/114.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/114.out +++ b/tests/qemu-iotests/114.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.base image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 backing file: TEST_DIR/t.IMGFMT.base backing file format: foo diff --git a/tests/qemu-iotests/126.out b/tests/qemu-iotests/126.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/126.out +++ b/tests/qemu-iotests/126.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/image:base.IMGFMT', fmt=IMGFMT size=67108864 Formatting 'TEST_DIR/image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=./image:base.IMGFMT image: TEST_DIR/image:top.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) backing file: ./image:base.IMGFMT (actual path: TEST_DIR/./image:base.IMGFMT) Formatting 'base.IMGFMT', fmt=IMGFMT size=67108864 Formatting 'file:image:top.IMGFMT', fmt=IMGFMT size=67108864 backing_file=base.IMGFMT image: ./image:top.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) backing file: base.IMGFMT (actual path: ./base.IMGFMT) *** done diff --git a/tests/qemu-iotests/130.out b/tests/qemu-iotests/130.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/130.out +++ b/tests/qemu-iotests/130.out @@ -XXX,XX +XXX,XX @@ Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) === HMP commit === @@ -XXX,XX +XXX,XX @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.orig backing_fmt=raw QEMU X.Y.Z monitor - type 'help' for more information (qemu) commit testdisk (qemu) image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) backing file: TEST_DIR/t.IMGFMT.orig backing file format: raw @@ -XXX,XX +XXX,XX @@ wrote 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t.IMGFMT.orig backing_fmt=raw wrote 4096/4096 bytes at offset 0 4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) backing file: TEST_DIR/t.IMGFMT.orig backing file format: raw *** done diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/153.out +++ b/tests/qemu-iotests/153.out @@ -XXX,XX +XXX,XX @@ _qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512 No conflict: image: null-co:// file format: null-co -virtual size: 1.0G (1073741824 bytes) +virtual size: 1 GiB (1073741824 bytes) disk size: unavailable Conflict: diff --git a/tests/qemu-iotests/191.out b/tests/qemu-iotests/191.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/191.out +++ b/tests/qemu-iotests/191.out @@ -XXX,XX +XXX,XX @@ wrote 65536/65536 bytes at offset 1048576 } image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 backing file: TEST_DIR/t.IMGFMT.base backing file format: IMGFMT image: TEST_DIR/t.IMGFMT.ovl2 file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 backing file: TEST_DIR/t.IMGFMT.base backing file format: IMGFMT @@ -XXX,XX +XXX,XX @@ wrote 65536/65536 bytes at offset 1048576 } image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 backing file: TEST_DIR/t.IMGFMT.base backing file format: IMGFMT image: TEST_DIR/t.IMGFMT.ovl2 file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 backing file: TEST_DIR/t.IMGFMT.base backing file format: IMGFMT diff --git a/tests/qemu-iotests/195.out b/tests/qemu-iotests/195.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/195.out +++ b/tests/qemu-iotests/195.out @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,backing.node-name=mid image: TEST_DIR/t.IMGFMT.mid file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 backing file: /dev/null backing file format: IMGFMT @@ -XXX,XX +XXX,XX @@ Testing: -drive if=none,file=TEST_DIR/t.IMGFMT,node-name=top image: TEST_DIR/t.IMGFMT file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 backing file: /dev/null backing file format: IMGFMT diff --git a/tests/qemu-iotests/198.out b/tests/qemu-iotests/198.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/198.out +++ b/tests/qemu-iotests/198.out @@ -XXX,XX +XXX,XX @@ read 16777216/16777216 bytes at offset 0 == checking image base == image: json:{"encrypt.key-secret": "sec0", "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT.base"}} file format: IMGFMT -virtual size: 16M (16777216 bytes) +virtual size: 16 MiB (16777216 bytes) Format specific information: encrypt: ivgen alg: plain64 @@ -XXX,XX +XXX,XX @@ Format specific information: == checking image layer == image: json:{"encrypt.key-secret": "sec1", "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}} file format: IMGFMT -virtual size: 16M (16777216 bytes) +virtual size: 16 MiB (16777216 bytes) backing file: TEST_DIR/t.IMGFMT.base Format specific information: encrypt: diff --git a/tests/qemu-iotests/206.out b/tests/qemu-iotests/206.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/206.out +++ b/tests/qemu-iotests/206.out @@ -XXX,XX +XXX,XX @@ image: TEST_IMG file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) cluster_size: 2097152 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) cluster_size: 512 backing file: TEST_IMG.base backing file format: IMGFMT @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) encrypted: yes cluster_size: 65536 Format specific information: diff --git a/tests/qemu-iotests/207.out b/tests/qemu-iotests/207.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/207.out +++ b/tests/qemu-iotests/207.out @@ -XXX,XX +XXX,XX @@ image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT -virtual size: 4.0M (4194304 bytes) +virtual size: 4 MiB (4194304 bytes) image: TEST_IMG file format: IMGFMT -virtual size: 4.0M (4194304 bytes) +virtual size: 4 MiB (4194304 bytes) === Test host-key-check options === @@ -XXX,XX +XXX,XX @@ virtual size: 4.0M (4194304 bytes) image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT -virtual size: 8.0M (8388608 bytes) +virtual size: 8 MiB (8388608 bytes) {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"mode": "known_hosts"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 4194304}}} {"return": {}} @@ -XXX,XX +XXX,XX @@ virtual size: 8.0M (8388608 bytes) image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT -virtual size: 4.0M (4194304 bytes) +virtual size: 4 MiB (4194304 bytes) {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": "hash", "type": "md5"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 2097152}}} {"return": {}} @@ -XXX,XX +XXX,XX @@ Job failed: remote host key does not match host_key_check 'wrong' image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT -virtual size: 8.0M (8388608 bytes) +virtual size: 8 MiB (8388608 bytes) {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": {"driver": "ssh", "location": {"host-key-check": {"hash": "wrong", "mode": "hash", "type": "sha1"}, "path": "TEST_DIR/PID-t.img", "server": {"host": "127.0.0.1", "port": "22"}}, "size": 2097152}}} {"return": {}} @@ -XXX,XX +XXX,XX @@ Job failed: remote host key does not match host_key_check 'wrong' image: json:{"driver": "IMGFMT", "file": {"server.host": "127.0.0.1", "server.port": "22", "driver": "ssh", "path": "TEST_IMG"}} file format: IMGFMT -virtual size: 4.0M (4194304 bytes) +virtual size: 4 MiB (4194304 bytes) === Invalid path and user === diff --git a/tests/qemu-iotests/210.out b/tests/qemu-iotests/210.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/210.out +++ b/tests/qemu-iotests/210.out @@ -XXX,XX +XXX,XX @@ image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_IMG"}, "key-secret": "keysec0"} file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) encrypted: yes Format specific information: ivgen alg: plain64 @@ -XXX,XX +XXX,XX @@ Format specific information: image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_IMG"}, "key-secret": "keysec0"} file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) encrypted: yes Format specific information: ivgen alg: plain64 @@ -XXX,XX +XXX,XX @@ Job failed: Cannot find device=this doesn't exist nor node_name=this doesn't exi image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_IMG"}, "key-secret": "keysec0"} file format: IMGFMT -virtual size: 0 (0 bytes) +virtual size: 0 B (0 bytes) encrypted: yes Format specific information: ivgen alg: plain64 @@ -XXX,XX +XXX,XX @@ Job failed: The requested file size is too large {"error": {"class": "GenericError", "desc": "Parameter 'size' expects a >0 size"}} image: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_IMG"}, "key-secret": "keysec0"} file format: IMGFMT -virtual size: 0 (0 bytes) +virtual size: 0 B (0 bytes) encrypted: yes Format specific information: ivgen alg: plain64 diff --git a/tests/qemu-iotests/211.out b/tests/qemu-iotests/211.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/211.out +++ b/tests/qemu-iotests/211.out @@ -XXX,XX +XXX,XX @@ image: TEST_IMG file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 1048576 [{ "start": 0, "length": 134217728, "depth": 0, "zero": true, "data": false}] @@ -XXX,XX +XXX,XX @@ cluster_size: 1048576 image: TEST_IMG file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 1048576 [{ "start": 0, "length": 67108864, "depth": 0, "zero": true, "data": false}] @@ -XXX,XX +XXX,XX @@ cluster_size: 1048576 image: TEST_IMG file format: IMGFMT -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) cluster_size: 1048576 [{ "start": 0, "length": 3072, "depth": 0, "zero": false, "data": true, "offset": 1024}, @@ -XXX,XX +XXX,XX @@ Job failed: Cannot find device=this doesn't exist nor node_name=this doesn't exi image: TEST_IMG file format: IMGFMT -virtual size: 0 (0 bytes) +virtual size: 0 B (0 bytes) cluster_size: 1048576 === Maximum size === @@ -XXX,XX +XXX,XX @@ cluster_size: 1048576 image: TEST_IMG file format: IMGFMT -virtual size: 512T (562949819203584 bytes) +virtual size: 512 TiB (562949819203584 bytes) cluster_size: 1048576 === Invalid sizes === diff --git a/tests/qemu-iotests/212.out b/tests/qemu-iotests/212.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/212.out +++ b/tests/qemu-iotests/212.out @@ -XXX,XX +XXX,XX @@ image: TEST_IMG file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) === Successful image creation (explicit defaults) === @@ -XXX,XX +XXX,XX @@ virtual size: 128M (134217728 bytes) image: TEST_IMG file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) === Successful image creation (with non-default options) === @@ -XXX,XX +XXX,XX @@ virtual size: 64M (67108864 bytes) image: TEST_IMG file format: IMGFMT -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) === Invalid BlockdevRef === @@ -XXX,XX +XXX,XX @@ Job failed: Cannot find device=this doesn't exist nor node_name=this doesn't exi image: TEST_IMG file format: IMGFMT -virtual size: 0 (0 bytes) +virtual size: 0 B (0 bytes) === Maximum size === @@ -XXX,XX +XXX,XX @@ virtual size: 0 (0 bytes) image: TEST_IMG file format: IMGFMT -virtual size: 4096T (4503599627369984 bytes) +virtual size: 4 PiB (4503599627369984 bytes) === Invalid sizes === diff --git a/tests/qemu-iotests/213.out b/tests/qemu-iotests/213.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/213.out +++ b/tests/qemu-iotests/213.out @@ -XXX,XX +XXX,XX @@ image: TEST_IMG file format: IMGFMT -virtual size: 128M (134217728 bytes) +virtual size: 128 MiB (134217728 bytes) cluster_size: 8388608 === Successful image creation (explicit defaults) === @@ -XXX,XX +XXX,XX @@ cluster_size: 8388608 image: TEST_IMG file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 8388608 === Successful image creation (with non-default options) === @@ -XXX,XX +XXX,XX @@ cluster_size: 8388608 image: TEST_IMG file format: IMGFMT -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) cluster_size: 268435456 === Invalid BlockdevRef === @@ -XXX,XX +XXX,XX @@ Job failed: Cannot find device=this doesn't exist nor node_name=this doesn't exi image: TEST_IMG file format: IMGFMT -virtual size: 0 (0 bytes) +virtual size: 0 B (0 bytes) cluster_size: 8388608 === Maximum size === @@ -XXX,XX +XXX,XX @@ cluster_size: 8388608 image: TEST_IMG file format: IMGFMT -virtual size: 64T (70368744177664 bytes) +virtual size: 64 TiB (70368744177664 bytes) cluster_size: 67108864 === Invalid sizes === diff --git a/tests/qemu-iotests/233.out b/tests/qemu-iotests/233.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/233.out +++ b/tests/qemu-iotests/233.out @@ -XXX,XX +XXX,XX @@ server reported: Option 0x8 not permitted before TLS == check TLS works == image: nbd://127.0.0.1:PORT file format: nbd -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) disk size: unavailable image: nbd://127.0.0.1:PORT file format: nbd -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) disk size: unavailable exports available: 1 export: '' diff --git a/tests/qemu-iotests/237.out b/tests/qemu-iotests/237.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/237.out +++ b/tests/qemu-iotests/237.out @@ -XXX,XX +XXX,XX @@ image: TEST_IMG file format: IMGFMT -virtual size: 5.0G (5368709120 bytes) +virtual size: 5 GiB (5368709120 bytes) cluster_size: 65536 Format specific information: cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 64M (67108864 bytes) +virtual size: 64 MiB (67108864 bytes) cluster_size: 65536 Format specific information: cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 32M (33554432 bytes) +virtual size: 32 MiB (33554432 bytes) cluster_size: 65536 Format specific information: cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Job failed: List of extents contains unused extents image: TEST_IMG file format: IMGFMT -virtual size: 512 (512 bytes) +virtual size: 512 B (512 bytes) Format specific information: cid: XXXXXXXXXX parent cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 512 (512 bytes) +virtual size: 512 B (512 bytes) cluster_size: 65536 Format specific information: cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 1.0G (1073741824 bytes) +virtual size: 1 GiB (1073741824 bytes) Format specific information: cid: XXXXXXXXXX parent cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 1.0G (1073741824 bytes) +virtual size: 1 GiB (1073741824 bytes) cluster_size: 65536 Format specific information: cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 2.0G (2147483648 bytes) +virtual size: 2 GiB (2147483648 bytes) Format specific information: cid: XXXXXXXXXX parent cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 2.0G (2147483648 bytes) +virtual size: 2 GiB (2147483648 bytes) cluster_size: 65536 Format specific information: cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 5.0G (5368709120 bytes) +virtual size: 5 GiB (5368709120 bytes) Format specific information: cid: XXXXXXXXXX parent cid: XXXXXXXXXX @@ -XXX,XX +XXX,XX @@ Format specific information: image: TEST_IMG file format: IMGFMT -virtual size: 5.0G (5368709120 bytes) +virtual size: 5 GiB (5368709120 bytes) cluster_size: 65536 Format specific information: cid: XXXXXXXXXX diff --git a/tests/qemu-iotests/242.out b/tests/qemu-iotests/242.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/242.out +++ b/tests/qemu-iotests/242.out @@ -XXX,XX +XXX,XX @@ qemu-img info dump: image: TEST_IMG file format: IMGFMT -virtual size: 1.0M (1048576 bytes) +virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ qemu-img info dump: image: TEST_IMG file format: IMGFMT -virtual size: 1.0M (1048576 bytes) +virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ qemu-img info dump: image: TEST_IMG file format: IMGFMT -virtual size: 1.0M (1048576 bytes) +virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ qemu-img info dump: image: TEST_IMG file format: IMGFMT -virtual size: 1.0M (1048576 bytes) +virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 @@ -XXX,XX +XXX,XX @@ Unset the unknown bitmap flag '0x4' in the bitmap directory entry: image: TEST_IMG file format: IMGFMT -virtual size: 1.0M (1048576 bytes) +virtual size: 1 MiB (1048576 bytes) cluster_size: 65536 Format specific information: compat: 1.1 -- 2.20.1
Limiting the allocation to INT_MAX bytes isn't particularly clever because it means that the final cluster will be a partial cluster which will be completed through a COW operation. This results in unnecessary data read and write requests which lead to an unwanted non-sparse filesystem block for metadata preallocation. Align the maximum allocation size down to the cluster size to avoid this situation. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index XXXXXXX..XXXXXXX 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -XXX,XX +XXX,XX @@ static int coroutine_fn preallocate_co(BlockDriverState *bs, uint64_t offset, bytes = new_length - offset; while (bytes) { - cur_bytes = MIN(bytes, INT_MAX); + cur_bytes = MIN(bytes, QEMU_ALIGN_DOWN(INT_MAX, s->cluster_size)); ret = qcow2_alloc_cluster_offset(bs, offset, &cur_bytes, &host_offset, &meta); if (ret < 0) { -- 2.20.1
We'll add a bdrv_co_truncate() call in the next patch which can return an Error that we don't want to discard. So add an errp parameter to preallocate_co(). Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> --- block/qcow2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index XXXXXXX..XXXXXXX 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -XXX,XX +XXX,XX @@ static int qcow2_set_up_encryption(BlockDriverState *bs, * Returns: 0 on success, -errno on failure. */ static int coroutine_fn preallocate_co(BlockDriverState *bs, uint64_t offset, - uint64_t new_length) + uint64_t new_length, Error **errp) { BDRVQcow2State *s = bs->opaque; uint64_t bytes; @@ -XXX,XX +XXX,XX @@ static int coroutine_fn preallocate_co(BlockDriverState *bs, uint64_t offset, ret = qcow2_alloc_cluster_offset(bs, offset, &cur_bytes, &host_offset, &meta); if (ret < 0) { + error_setg_errno(errp, -ret, "Allocating clusters failed"); return ret; } @@ -XXX,XX +XXX,XX @@ static int coroutine_fn preallocate_co(BlockDriverState *bs, uint64_t offset, ret = qcow2_alloc_cluster_link_l2(bs, meta); if (ret < 0) { + error_setg_errno(errp, -ret, "Mapping clusters failed"); qcow2_free_any_clusters(bs, meta->alloc_offset, meta->nb_clusters, QCOW2_DISCARD_NEVER); return ret; @@ -XXX,XX +XXX,XX @@ static int coroutine_fn preallocate_co(BlockDriverState *bs, uint64_t offset, ret = bdrv_pwrite(s->data_file, (host_offset + cur_bytes) - 1, &data, 1); if (ret < 0) { + error_setg_errno(errp, -ret, "Writing to EOF failed"); return ret; } } @@ -XXX,XX +XXX,XX @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset, break; case PREALLOC_MODE_METADATA: - ret = preallocate_co(bs, old_length, offset); + ret = preallocate_co(bs, old_length, offset, errp); if (ret < 0) { - error_setg_errno(errp, -ret, "Preallocation failed"); goto fail; } break; @@ -XXX,XX +XXX,XX @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset, /* With a data file, preallocation means just allocating the metadata * and forwarding the truncate request to the data file */ if (has_data_file(bs)) { - ret = preallocate_co(bs, old_length, offset); + ret = preallocate_co(bs, old_length, offset, errp); if (ret < 0) { - error_setg_errno(errp, -ret, "Preallocation failed"); goto fail; } break; -- 2.20.1
preallocate_co() already gave the data file the full size without forwarding the requested preallocation mode to the protocol. When bdrv_co_truncate() was called later with the preallocation mode, the file didn't actually grow any more, so the data file stayed unallocated even if full preallocation was requested. Pass the right preallocation mode to preallocate_co() and remove the second bdrv_co_truncate() to fix this. As a side effect, the ugly one-byte write in preallocate_co() is replaced with a truncate call, now leaving the last block unallocated on the protocol level as it should be. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> --- block/qcow2.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index XXXXXXX..XXXXXXX 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -XXX,XX +XXX,XX @@ static int qcow2_set_up_encryption(BlockDriverState *bs, * Returns: 0 on success, -errno on failure. */ static int coroutine_fn preallocate_co(BlockDriverState *bs, uint64_t offset, - uint64_t new_length, Error **errp) + uint64_t new_length, PreallocMode mode, + Error **errp) { BDRVQcow2State *s = bs->opaque; uint64_t bytes; uint64_t host_offset = 0; + int64_t file_length; unsigned int cur_bytes; int ret; QCowL2Meta *meta; @@ -XXX,XX +XXX,XX @@ static int coroutine_fn preallocate_co(BlockDriverState *bs, uint64_t offset, * all of the allocated clusters (otherwise we get failing reads after * EOF). Extend the image to the last allocated sector. */ - if (host_offset != 0) { - uint8_t data = 0; - ret = bdrv_pwrite(s->data_file, (host_offset + cur_bytes) - 1, - &data, 1); + file_length = bdrv_getlength(s->data_file->bs); + if (file_length < 0) { + error_setg_errno(errp, -file_length, "Could not get file size"); + return file_length; + } + + if (host_offset + cur_bytes > file_length) { + if (mode == PREALLOC_MODE_METADATA) { + mode = PREALLOC_MODE_OFF; + } + ret = bdrv_co_truncate(s->data_file, host_offset + cur_bytes, mode, + errp); if (ret < 0) { - error_setg_errno(errp, -ret, "Writing to EOF failed"); return ret; } } @@ -XXX,XX +XXX,XX @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset, switch (prealloc) { case PREALLOC_MODE_OFF: + if (has_data_file(bs)) { + ret = bdrv_co_truncate(s->data_file, offset, prealloc, errp); + if (ret < 0) { + goto fail; + } + } break; case PREALLOC_MODE_METADATA: - ret = preallocate_co(bs, old_length, offset, errp); + ret = preallocate_co(bs, old_length, offset, prealloc, errp); if (ret < 0) { goto fail; } @@ -XXX,XX +XXX,XX @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset, /* With a data file, preallocation means just allocating the metadata * and forwarding the truncate request to the data file */ if (has_data_file(bs)) { - ret = preallocate_co(bs, old_length, offset, errp); + ret = preallocate_co(bs, old_length, offset, prealloc, errp); if (ret < 0) { goto fail; } @@ -XXX,XX +XXX,XX @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset, bs->total_sectors = offset / BDRV_SECTOR_SIZE; - if (has_data_file(bs)) { - if (prealloc == PREALLOC_MODE_METADATA) { - prealloc = PREALLOC_MODE_OFF; - } - ret = bdrv_co_truncate(s->data_file, offset, prealloc, errp); - if (ret < 0) { - goto fail; - } - } - /* write updated header.size */ offset = cpu_to_be64(offset); ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, size), -- 2.20.1
From: Max Reitz <mreitz@redhat.com> In the "amend" section of 082, we perform a single "convert" test (namely "convert -o help"). That does not make sense, especially because we have done exactly that "convert" test earlier in 082 already. Replacing "convert" by "amend" yields an error, which is correct because there is no point in "amend" having a default format. The user has to either specify the format, or give a file for qemu-img to probe. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- tests/qemu-iotests/082 | 5 ++++- tests/qemu-iotests/082.out | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082 index XXXXXXX..XXXXXXX 100755 --- a/tests/qemu-iotests/082 +++ b/tests/qemu-iotests/082 @@ -XXX,XX +XXX,XX @@ run_qemu_img amend -f $IMGFMT -o backing_file="$TEST_IMG" -o ,, -o help "$TEST_I # Leave out everything that isn't needed run_qemu_img amend -f $IMGFMT -o help -run_qemu_img convert -o help + +# amend requires specifying either a format explicitly, or a file +# which it can probe +run_qemu_img amend -o help # Try help option for a format that does not support amendment run_qemu_img amend -f bochs -o help diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/082.out +++ b/tests/qemu-iotests/082.out @@ -XXX,XX +XXX,XX @@ Creation options for 'qcow2': Note that not all of these options may be amendable. -Testing: convert -o help -Supported options: - size=<size> - Virtual disk size +Testing: amend -o help +qemu-img: Expecting one image file name Testing: amend -f bochs -o help qemu-img: Format driver 'bochs' does not support option amendment -- 2.20.1
From: Max Reitz <mreitz@redhat.com> qemu-img create allows giving just a format and "-o help" to get a list of the options supported by that format. Users may not realize that the protocol level may offer even more options, which they only get to see by specifying a filename. This patch adds a note to hint at that fact. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- qemu-img.c | 13 ++++++++++++- tests/qemu-iotests/082.out | 20 ++++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index XXXXXXX..XXXXXXX 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -XXX,XX +XXX,XX @@ static int print_block_option_help(const char *filename, const char *fmt) create_opts = qemu_opts_append(create_opts, proto_drv->create_opts); } - printf("Supported options:\n"); + if (filename) { + printf("Supported options:\n"); + } else { + printf("Supported %s options:\n", fmt); + } qemu_opts_print_help(create_opts, false); qemu_opts_free(create_opts); + + if (!filename) { + printf("\n" + "The protocol level may support further options.\n" + "Specify the target filename to include those options.\n"); + } + return 0; } diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/082.out +++ b/tests/qemu-iotests/082.out @@ -XXX,XX +XXX,XX @@ Testing: create -f qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DIR qemu-img: Invalid option list: ,, Testing: create -f qcow2 -o help -Supported options: +Supported qcow2 options: backing_file=<str> - File name of a base image backing_fmt=<str> - Image format of the base image cluster_size=<size> - qcow2 cluster size @@ -XXX,XX +XXX,XX @@ Supported options: refcount_bits=<num> - Width of a reference count entry in bits size=<size> - Virtual disk size +The protocol level may support further options. +Specify the target filename to include those options. + Testing: create -o help -Supported options: +Supported raw options: size=<size> - Virtual disk size +The protocol level may support further options. +Specify the target filename to include those options. + Testing: create -f bochs -o help qemu-img: Format driver 'bochs' does not support image creation @@ -XXX,XX +XXX,XX @@ Testing: convert -O qcow2 -o backing_file=TEST_DIR/t.qcow2 -o ,, -o help TEST_DI qemu-img: Invalid option list: ,, Testing: convert -O qcow2 -o help -Supported options: +Supported qcow2 options: backing_file=<str> - File name of a base image backing_fmt=<str> - Image format of the base image cluster_size=<size> - qcow2 cluster size @@ -XXX,XX +XXX,XX @@ Supported options: refcount_bits=<num> - Width of a reference count entry in bits size=<size> - Virtual disk size +The protocol level may support further options. +Specify the target filename to include those options. + Testing: convert -o help -Supported options: +Supported raw options: size=<size> - Virtual disk size +The protocol level may support further options. +Specify the target filename to include those options. + Testing: convert -O bochs -o help qemu-img: Format driver 'bochs' does not support image creation -- 2.20.1
make_completely_empty() is an optimisated path for bdrv_make_empty() where completely new metadata is created inside the image file instead of going through all clusters and discarding them. For an external data file, however, we actually need to do discard operations on the data file; just overwriting the qcow2 file doesn't get rid of the data. The necessary slow path with an explicit discard operation already exists for other cases. Use it for external data files, too. Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> --- block/qcow2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index XXXXXXX..XXXXXXX 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -XXX,XX +XXX,XX @@ static int qcow2_make_empty(BlockDriverState *bs) if (s->qcow_version >= 3 && !s->snapshots && !s->nb_bitmaps && 3 + l1_clusters <= s->refcount_block_size && - s->crypt_method_header != QCOW_CRYPT_LUKS) { + s->crypt_method_header != QCOW_CRYPT_LUKS && + !has_data_file(bs)) { /* The following function only works for qcow2 v3 images (it * requires the dirty flag) and only as long as there are no * features that reserve extra clusters (such as snapshots, * LUKS header, or persistent bitmaps), because it completely * empties the image. Furthermore, the L1 table and three * additional clusters (image header, refcount table, one - * refcount block) have to fit inside one refcount block. */ + * refcount block) have to fit inside one refcount block. It + * only resets the image file, i.e. does not work with an + * external data file. */ return make_completely_empty(bs); } -- 2.20.1
From: Alberto Garcia <berto@igalia.com> This patch fixes a few things in the way error codes are handled in the qcow2 compression code: a) qcow2_co_pwritev_compressed() expects qcow2_co_compress() to only return -1 or -2 on failure, but this is not correct. Since the change from qcow2_compress() to qcow2_co_compress() in commit ceb029cd6feccf9f7607 the new code can also return -EINVAL (although there does not seem to exist any code path that would cause that error in the current implementation). b) -1 and -2 are ad-hoc error codes defined in qcow2_compress(). This patch replaces them with standard constants from errno.h. c) Both qcow2_compress() and qcow2_co_do_compress() return a negative value on failure, but qcow2_co_pwritev_compressed() stores the value in an unsigned data type. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/qcow2.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index XXXXXXX..XXXXXXX 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -XXX,XX +XXX,XX @@ fail: * @src - source buffer, @src_size bytes * * Returns: compressed size on success - * -1 destination buffer is not enough to store compressed data - * -2 on any other error + * -ENOMEM destination buffer is not enough to store compressed data + * -EIO on any other error */ static ssize_t qcow2_compress(void *dest, size_t dest_size, const void *src, size_t src_size) @@ -XXX,XX +XXX,XX @@ static ssize_t qcow2_compress(void *dest, size_t dest_size, ret = deflateInit2(&strm, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -12, 9, Z_DEFAULT_STRATEGY); if (ret != Z_OK) { - return -2; + return -EIO; } /* strm.next_in is not const in old zlib versions, such as those used on @@ -XXX,XX +XXX,XX @@ static ssize_t qcow2_compress(void *dest, size_t dest_size, if (ret == Z_STREAM_END) { ret = dest_size - strm.avail_out; } else { - ret = (ret == Z_OK ? -1 : -2); + ret = (ret == Z_OK ? -ENOMEM : -EIO); } deflateEnd(&strm); @@ -XXX,XX +XXX,XX @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, BDRVQcow2State *s = bs->opaque; QEMUIOVector hd_qiov; int ret; - size_t out_len; + ssize_t out_len; uint8_t *buf, *out_buf; uint64_t cluster_offset; @@ -XXX,XX +XXX,XX @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, out_len = qcow2_co_compress(bs, out_buf, s->cluster_size - 1, buf, s->cluster_size); - if (out_len == -2) { - ret = -EINVAL; - goto fail; - } else if (out_len == -1) { + if (out_len == -ENOMEM) { /* could not compress: write normal cluster */ ret = qcow2_co_pwritev(bs, offset, bytes, qiov, 0); if (ret < 0) { goto fail; } goto success; + } else if (out_len < 0) { + ret = -EINVAL; + goto fail; } qemu_co_mutex_lock(&s->lock); -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- include/block/block_int.h | 16 ++++++++++++++++ include/sysemu/block-backend.h | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/include/block/block_int.h b/include/block/block_int.h index XXXXXXX..XXXXXXX 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -XXX,XX +XXX,XX @@ int coroutine_fn bdrv_co_pwritev(BdrvChild *child, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); +static inline int coroutine_fn bdrv_co_pread(BdrvChild *child, + int64_t offset, unsigned int bytes, void *buf, BdrvRequestFlags flags) +{ + QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); + + return bdrv_co_preadv(child, offset, bytes, &qiov, flags); +} + +static inline int coroutine_fn bdrv_co_pwrite(BdrvChild *child, + int64_t offset, unsigned int bytes, void *buf, BdrvRequestFlags flags) +{ + QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); + + return bdrv_co_pwritev(child, offset, bytes, &qiov, flags); +} + extern unsigned int bdrv_drain_all_count; void bdrv_apply_subtree_drain(BdrvChild *child, BlockDriverState *new_parent); void bdrv_unapply_subtree_drain(BdrvChild *child, BlockDriverState *old_parent); diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index XXXXXXX..XXXXXXX 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -XXX,XX +XXX,XX @@ int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, unsigned int bytes, QEMUIOVector *qiov, BdrvRequestFlags flags); + +static inline int coroutine_fn blk_co_pread(BlockBackend *blk, int64_t offset, + unsigned int bytes, void *buf, + BdrvRequestFlags flags) +{ + QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); + + return blk_co_preadv(blk, offset, bytes, &qiov, flags); +} + +static inline int coroutine_fn blk_co_pwrite(BlockBackend *blk, int64_t offset, + unsigned int bytes, void *buf, + BdrvRequestFlags flags) +{ + QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); + + return blk_co_pwritev(blk, offset, bytes, &qiov, flags); +} + int blk_pwrite_zeroes(BlockBackend *blk, int64_t offset, int bytes, BdrvRequestFlags flags); BlockAIOCB *blk_aio_pwrite_zeroes(BlockBackend *blk, int64_t offset, -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/qcow2.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index XXXXXXX..XXXXXXX 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -XXX,XX +XXX,XX @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov) { BDRVQcow2State *s = bs->opaque; - QEMUIOVector hd_qiov; int ret; ssize_t out_len; uint8_t *buf, *out_buf; @@ -XXX,XX +XXX,XX @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, goto fail; } - qemu_iovec_init_buf(&hd_qiov, out_buf, out_len); - BLKDBG_EVENT(s->data_file, BLKDBG_WRITE_COMPRESSED); - ret = bdrv_co_pwritev(s->data_file, cluster_offset, out_len, &hd_qiov, 0); + ret = bdrv_co_pwrite(s->data_file, cluster_offset, out_len, out_buf, 0); if (ret < 0) { goto fail; } @@ -XXX,XX +XXX,XX @@ qcow2_co_preadv_compressed(BlockDriverState *bs, int ret = 0, csize, nb_csectors; uint64_t coffset; uint8_t *buf, *out_buf; - QEMUIOVector local_qiov; int offset_in_cluster = offset_into_cluster(s, offset); coffset = file_cluster_offset & s->cluster_offset_mask; @@ -XXX,XX +XXX,XX @@ qcow2_co_preadv_compressed(BlockDriverState *bs, if (!buf) { return -ENOMEM; } - qemu_iovec_init_buf(&local_qiov, buf, csize); out_buf = qemu_blockalign(bs, s->cluster_size); BLKDBG_EVENT(bs->file, BLKDBG_READ_COMPRESSED); - ret = bdrv_co_preadv(bs->file, coffset, csize, &local_qiov, 0); + ret = bdrv_co_pread(bs->file, coffset, csize, buf, 0); if (ret < 0) { goto fail; } -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/qcow.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/block/qcow.c b/block/qcow.c index XXXXXXX..XXXXXXX 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -XXX,XX +XXX,XX @@ static coroutine_fn int qcow_co_preadv(BlockDriverState *bs, uint64_t offset, int offset_in_cluster; int ret = 0, n; uint64_t cluster_offset; - QEMUIOVector hd_qiov; uint8_t *buf; void *orig_buf; @@ -XXX,XX +XXX,XX @@ static coroutine_fn int qcow_co_preadv(BlockDriverState *bs, uint64_t offset, if (!cluster_offset) { if (bs->backing) { /* read from the base image */ - qemu_iovec_init_buf(&hd_qiov, buf, n); qemu_co_mutex_unlock(&s->lock); /* qcow2 emits this on bs->file instead of bs->backing */ BLKDBG_EVENT(bs->file, BLKDBG_READ_BACKING_AIO); - ret = bdrv_co_preadv(bs->backing, offset, n, &hd_qiov, 0); + ret = bdrv_co_pread(bs->backing, offset, n, buf, 0); qemu_co_mutex_lock(&s->lock); if (ret < 0) { break; @@ -XXX,XX +XXX,XX @@ static coroutine_fn int qcow_co_preadv(BlockDriverState *bs, uint64_t offset, ret = -EIO; break; } - qemu_iovec_init_buf(&hd_qiov, buf, n); qemu_co_mutex_unlock(&s->lock); BLKDBG_EVENT(bs->file, BLKDBG_READ_AIO); - ret = bdrv_co_preadv(bs->file, cluster_offset + offset_in_cluster, - n, &hd_qiov, 0); + ret = bdrv_co_pread(bs->file, cluster_offset + offset_in_cluster, + n, buf, 0); qemu_co_mutex_lock(&s->lock); if (ret < 0) { break; @@ -XXX,XX +XXX,XX @@ static coroutine_fn int qcow_co_pwritev(BlockDriverState *bs, uint64_t offset, int offset_in_cluster; uint64_t cluster_offset; int ret = 0, n; - QEMUIOVector hd_qiov; uint8_t *buf; void *orig_buf; @@ -XXX,XX +XXX,XX @@ static coroutine_fn int qcow_co_pwritev(BlockDriverState *bs, uint64_t offset, } } - qemu_iovec_init_buf(&hd_qiov, buf, n); qemu_co_mutex_unlock(&s->lock); BLKDBG_EVENT(bs->file, BLKDBG_WRITE_AIO); - ret = bdrv_co_pwritev(bs->file, cluster_offset + offset_in_cluster, - n, &hd_qiov, 0); + ret = bdrv_co_pwrite(bs->file, cluster_offset + offset_in_cluster, + n, buf, 0); qemu_co_mutex_lock(&s->lock); if (ret < 0) { break; @@ -XXX,XX +XXX,XX @@ qcow_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, uint64_t bytes, QEMUIOVector *qiov) { BDRVQcowState *s = bs->opaque; - QEMUIOVector hd_qiov; z_stream strm; int ret, out_len; uint8_t *buf, *out_buf; @@ -XXX,XX +XXX,XX @@ qcow_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, } cluster_offset &= s->cluster_offset_mask; - qemu_iovec_init_buf(&hd_qiov, out_buf, out_len); BLKDBG_EVENT(bs->file, BLKDBG_WRITE_COMPRESSED); - ret = bdrv_co_pwritev(bs->file, cluster_offset, out_len, &hd_qiov, 0); + ret = bdrv_co_pwrite(bs->file, cluster_offset, out_len, out_buf, 0); if (ret < 0) { goto fail; } -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Move to _co_ versions of io functions qed_read_table() and qed_write_table(), as we use qemu_co_mutex_unlock() anyway. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/qed-table.c | 12 +++++------- block/qed.c | 6 ++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/block/qed-table.c b/block/qed-table.c index XXXXXXX..XXXXXXX 100644 --- a/block/qed-table.c +++ b/block/qed-table.c @@ -XXX,XX +XXX,XX @@ /* Called with table_lock held. */ static int qed_read_table(BDRVQEDState *s, uint64_t offset, QEDTable *table) { - QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF( - qiov, table->offsets, s->header.cluster_size * s->header.table_size); + unsigned int bytes = s->header.cluster_size * s->header.table_size; + int noffsets; int i, ret; trace_qed_read_table(s, offset, table); qemu_co_mutex_unlock(&s->table_lock); - ret = bdrv_preadv(s->bs->file, offset, &qiov); + ret = bdrv_co_pread(s->bs->file, offset, bytes, table->offsets, 0); qemu_co_mutex_lock(&s->table_lock); if (ret < 0) { goto out; } /* Byteswap offsets */ - noffsets = qiov.size / sizeof(uint64_t); + noffsets = bytes / sizeof(uint64_t); for (i = 0; i < noffsets; i++) { table->offsets[i] = le64_to_cpu(table->offsets[i]); } @@ -XXX,XX +XXX,XX @@ static int qed_write_table(BDRVQEDState *s, uint64_t offset, QEDTable *table, unsigned int sector_mask = BDRV_SECTOR_SIZE / sizeof(uint64_t) - 1; unsigned int start, end, i; QEDTable *new_table; - QEMUIOVector qiov; size_t len_bytes; int ret; @@ -XXX,XX +XXX,XX @@ static int qed_write_table(BDRVQEDState *s, uint64_t offset, QEDTable *table, len_bytes = (end - start) * sizeof(uint64_t); new_table = qemu_blockalign(s->bs, len_bytes); - qemu_iovec_init_buf(&qiov, new_table->offsets, len_bytes); /* Byteswap table */ for (i = start; i < end; i++) { @@ -XXX,XX +XXX,XX @@ static int qed_write_table(BDRVQEDState *s, uint64_t offset, QEDTable *table, offset += start * sizeof(uint64_t); qemu_co_mutex_unlock(&s->table_lock); - ret = bdrv_pwritev(s->bs->file, offset, &qiov); + ret = bdrv_co_pwrite(s->bs->file, offset, len_bytes, new_table->offsets, 0); qemu_co_mutex_lock(&s->table_lock); trace_qed_write_table_cb(s, table, flush, ret); if (ret < 0) { diff --git a/block/qed.c b/block/qed.c index XXXXXXX..XXXXXXX 100644 --- a/block/qed.c +++ b/block/qed.c @@ -XXX,XX +XXX,XX @@ static int coroutine_fn qed_write_header(BDRVQEDState *s) int nsectors = DIV_ROUND_UP(sizeof(QEDHeader), BDRV_SECTOR_SIZE); size_t len = nsectors * BDRV_SECTOR_SIZE; uint8_t *buf; - QEMUIOVector qiov; int ret; assert(s->allocating_acb || s->allocating_write_reqs_plugged); buf = qemu_blockalign(s->bs, len); - qemu_iovec_init_buf(&qiov, buf, len); - ret = bdrv_co_preadv(s->bs->file, 0, qiov.size, &qiov, 0); + ret = bdrv_co_pread(s->bs->file, 0, len, buf, 0); if (ret < 0) { goto out; } @@ -XXX,XX +XXX,XX @@ static int coroutine_fn qed_write_header(BDRVQEDState *s) /* Update header */ qed_header_cpu_to_le(&s->header, (QEDHeader *) buf); - ret = bdrv_co_pwritev(s->bs->file, 0, qiov.size, &qiov, 0); + ret = bdrv_co_pwrite(s->bs->file, 0, len, buf, 0); if (ret < 0) { goto out; } -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/parallels.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/block/parallels.c b/block/parallels.c index XXXXXXX..XXXXXXX 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -XXX,XX +XXX,XX @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num, if (bs->backing) { int64_t nb_cow_sectors = to_allocate * s->tracks; int64_t nb_cow_bytes = nb_cow_sectors << BDRV_SECTOR_BITS; - QEMUIOVector qiov = - QEMU_IOVEC_INIT_BUF(qiov, qemu_blockalign(bs, nb_cow_bytes), - nb_cow_bytes); + void *buf = qemu_blockalign(bs, nb_cow_bytes); - ret = bdrv_co_preadv(bs->backing, idx * s->tracks * BDRV_SECTOR_SIZE, - nb_cow_bytes, &qiov, 0); + ret = bdrv_co_pread(bs->backing, idx * s->tracks * BDRV_SECTOR_SIZE, + nb_cow_bytes, buf, 0); if (ret < 0) { - qemu_vfree(qemu_iovec_buf(&qiov)); + qemu_vfree(buf); return ret; } ret = bdrv_co_pwritev(bs->file, s->data_end * BDRV_SECTOR_SIZE, - nb_cow_bytes, &qiov, 0); - qemu_vfree(qemu_iovec_buf(&qiov)); + nb_cow_bytes, buf, 0); + qemu_vfree(buf); if (ret < 0) { return ret; } -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/backup.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/block/backup.c b/block/backup.c index XXXXXXX..XXXXXXX 100644 --- a/block/backup.c +++ b/block/backup.c @@ -XXX,XX +XXX,XX @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job, void **bounce_buffer) { int ret; - QEMUIOVector qiov; BlockBackend *blk = job->common.blk; int nbytes; int read_flags = is_write_notifier ? BDRV_REQ_NO_SERIALISING : 0; @@ -XXX,XX +XXX,XX @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job, if (!*bounce_buffer) { *bounce_buffer = blk_blockalign(blk, job->cluster_size); } - qemu_iovec_init_buf(&qiov, *bounce_buffer, nbytes); - ret = blk_co_preadv(blk, start, qiov.size, &qiov, read_flags); + ret = blk_co_pread(blk, start, nbytes, *bounce_buffer, read_flags); if (ret < 0) { trace_backup_do_cow_read_fail(job, start, ret); if (error_is_read) { @@ -XXX,XX +XXX,XX @@ static int coroutine_fn backup_cow_with_bounce_buffer(BackupBlockJob *job, goto fail; } - if (qemu_iovec_is_zero(&qiov)) { + if (buffer_is_zero(*bounce_buffer, nbytes)) { ret = blk_co_pwrite_zeroes(job->target, start, - qiov.size, write_flags | BDRV_REQ_MAY_UNMAP); + nbytes, write_flags | BDRV_REQ_MAY_UNMAP); } else { - ret = blk_co_pwritev(job->target, start, - qiov.size, &qiov, write_flags | - (job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0)); + ret = blk_co_pwrite(job->target, start, + nbytes, *bounce_buffer, write_flags | + (job->compress ? BDRV_REQ_WRITE_COMPRESSED : 0)); } if (ret < 0) { trace_backup_do_cow_write_fail(job, start, ret); -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/commit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/commit.c b/block/commit.c index XXXXXXX..XXXXXXX 100644 --- a/block/commit.c +++ b/block/commit.c @@ -XXX,XX +XXX,XX @@ static int coroutine_fn commit_populate(BlockBackend *bs, BlockBackend *base, void *buf) { int ret = 0; - QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); assert(bytes < SIZE_MAX); - ret = blk_co_preadv(bs, offset, qiov.size, &qiov, 0); + ret = blk_co_pread(bs, offset, bytes, buf, 0); if (ret < 0) { return ret; } - ret = blk_co_pwritev(base, offset, qiov.size, &qiov, 0); + ret = blk_co_pwrite(base, offset, bytes, buf, 0); if (ret < 0) { return ret; } -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/stream.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/stream.c b/block/stream.c index XXXXXXX..XXXXXXX 100644 --- a/block/stream.c +++ b/block/stream.c @@ -XXX,XX +XXX,XX @@ static int coroutine_fn stream_populate(BlockBackend *blk, int64_t offset, uint64_t bytes, void *buf) { - QEMUIOVector qiov = QEMU_IOVEC_INIT_BUF(qiov, buf, bytes); - assert(bytes < SIZE_MAX); /* Copy-on-read the unallocated clusters */ - return blk_co_preadv(blk, offset, qiov.size, &qiov, BDRV_REQ_COPY_ON_READ); + return blk_co_pread(blk, offset, bytes, buf, BDRV_REQ_COPY_ON_READ); } static void stream_abort(Job *job) -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- qemu-img.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index XXXXXXX..XXXXXXX 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -XXX,XX +XXX,XX @@ static int coroutine_fn convert_co_read(ImgConvertState *s, int64_t sector_num, int nb_sectors, uint8_t *buf) { int n, ret; - QEMUIOVector qiov; assert(nb_sectors <= s->buf_sectors); while (nb_sectors > 0) { @@ -XXX,XX +XXX,XX @@ static int coroutine_fn convert_co_read(ImgConvertState *s, int64_t sector_num, bs_sectors = s->src_sectors[src_cur]; n = MIN(nb_sectors, bs_sectors - (sector_num - src_cur_offset)); - qemu_iovec_init_buf(&qiov, buf, n << BDRV_SECTOR_BITS); - ret = blk_co_preadv( + ret = blk_co_pread( blk, (sector_num - src_cur_offset) << BDRV_SECTOR_BITS, - n << BDRV_SECTOR_BITS, &qiov, 0); + n << BDRV_SECTOR_BITS, buf, 0); if (ret < 0) { return ret; } @@ -XXX,XX +XXX,XX @@ static int coroutine_fn convert_co_write(ImgConvertState *s, int64_t sector_num, enum ImgConvertBlockStatus status) { int ret; - QEMUIOVector qiov; while (nb_sectors > 0) { int n = nb_sectors; @@ -XXX,XX +XXX,XX @@ static int coroutine_fn convert_co_write(ImgConvertState *s, int64_t sector_num, (s->compressed && !buffer_is_zero(buf, n * BDRV_SECTOR_SIZE))) { - qemu_iovec_init_buf(&qiov, buf, n << BDRV_SECTOR_BITS); - - ret = blk_co_pwritev(s->target, sector_num << BDRV_SECTOR_BITS, - n << BDRV_SECTOR_BITS, &qiov, flags); + ret = blk_co_pwrite(s->target, sector_num << BDRV_SECTOR_BITS, + n << BDRV_SECTOR_BITS, buf, flags); if (ret < 0) { return ret; } -- 2.20.1
From: Alberto Garcia <berto@igalia.com> You can reproduce this by passing an invalid filter-node-name (like "1234") to block-commit. In this case the base image is put in read-write mode but is never reset back to read-only. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/commit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/commit.c b/block/commit.c index XXXXXXX..XXXXXXX 100644 --- a/block/commit.c +++ b/block/commit.c @@ -XXX,XX +XXX,XX @@ fail: if (s->top) { blk_unref(s->top); } + if (s->base_read_only) { + bdrv_reopen_set_read_only(base, true, NULL); + } job_early_fail(&s->common.job); /* commit_top_bs has to be replaced after deleting the block job, * otherwise this would fail because of lack of permissions. */ -- 2.20.1
From: Alberto Garcia <berto@igalia.com> This tests the fix from the previous patch. Signed-off-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- tests/qemu-iotests/249 | 115 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/249.out | 35 +++++++++++ tests/qemu-iotests/group | 1 + 3 files changed, 151 insertions(+) create mode 100755 tests/qemu-iotests/249 create mode 100644 tests/qemu-iotests/249.out diff --git a/tests/qemu-iotests/249 b/tests/qemu-iotests/249 new file mode 100755 index XXXXXXX..XXXXXXX --- /dev/null +++ b/tests/qemu-iotests/249 @@ -XXX,XX +XXX,XX @@ +#!/usr/bin/env bash +# +# Test that a backing image is put back in read-only mode after +# block-commit (both when it fails and when it succeeds). +# +# Copyright (C) 2019 Igalia, S.L. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +# creator +owner=berto@igalia.com + +seq="$(basename $0)" +echo "QA output created by $seq" + +status=1 # failure is the default! + +_cleanup() +{ + _cleanup_test_img + rm -f "$TEST_IMG.base" + rm -f "$TEST_IMG.int" +} +trap "_cleanup; exit \$status" 0 1 2 3 15 + +# get standard environment, filters and checks +. ./common.rc +. ./common.filter +. ./common.qemu + +# Any format implementing BlockDriver.bdrv_change_backing_file +_supported_fmt qcow2 qed +_supported_proto file +_supported_os Linux + +IMG_SIZE=1M + +# Create the images: base <- int <- active +TEST_IMG="$TEST_IMG.base" _make_test_img $IMG_SIZE | _filter_imgfmt +TEST_IMG="$TEST_IMG.int" _make_test_img -b "$TEST_IMG.base" | _filter_imgfmt +_make_test_img -b "$TEST_IMG.int" | _filter_imgfmt + +# Launch QEMU with these two drives: +# none0: base (read-only) +# none1: base <- int <- active +_launch_qemu -drive if=none,file="${TEST_IMG}.base",node-name=base,read-only=on \ + -drive if=none,file="${TEST_IMG}",backing.node-name=int,backing.backing=base + +_send_qemu_cmd $QEMU_HANDLE \ + "{ 'execute': 'qmp_capabilities' }" \ + 'return' + +echo +echo '=== Send a write command to a drive opened in read-only mode (1)' +echo +_send_qemu_cmd $QEMU_HANDLE \ + "{ 'execute': 'human-monitor-command', + 'arguments': {'command-line': 'qemu-io none0 \"aio_write 0 2k\"'}}" \ + 'return' + +echo +echo '=== Run block-commit on base using an invalid filter node name' +echo +_send_qemu_cmd $QEMU_HANDLE \ + "{ 'execute': 'block-commit', + 'arguments': {'job-id': 'job0', 'device': 'none1', 'top-node': 'int', + 'filter-node-name': '1234'}}" \ + 'error' + +echo +echo '=== Send a write command to a drive opened in read-only mode (2)' +echo +_send_qemu_cmd $QEMU_HANDLE \ + "{ 'execute': 'human-monitor-command', + 'arguments': {'command-line': 'qemu-io none0 \"aio_write 0 2k\"'}}" \ + 'return' + +echo +echo '=== Run block-commit on base using the default filter node name' +echo +_send_qemu_cmd $QEMU_HANDLE \ + "{ 'execute': 'block-commit', + 'arguments': {'job-id': 'job0', 'device': 'none1', 'top-node': 'int'}}" \ + 'return' + +# Wait for block-commit to finish +_send_qemu_cmd $QEMU_HANDLE '' \ + '"status": "null"' + +echo +echo '=== Send a write command to a drive opened in read-only mode (3)' +echo +_send_qemu_cmd $QEMU_HANDLE \ + "{ 'execute': 'human-monitor-command', + 'arguments': {'command-line': 'qemu-io none0 \"aio_write 0 2k\"'}}" \ + 'return' + +_cleanup_qemu + +# success, all done +echo "*** done" +rm -f $seq.full +status=0 diff --git a/tests/qemu-iotests/249.out b/tests/qemu-iotests/249.out new file mode 100644 index XXXXXXX..XXXXXXX --- /dev/null +++ b/tests/qemu-iotests/249.out @@ -XXX,XX +XXX,XX @@ +QA output created by 249 +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=1048576 +Formatting 'TEST_DIR/t.IMGFMT.int', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.base +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 backing_file=TEST_DIR/t.IMGFMT.int +{"return": {}} + +=== Send a write command to a drive opened in read-only mode (1) + +{"return": "Block node is read-onlyrn"} + +=== Run block-commit on base using an invalid filter node name + +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} +{"error": {"class": "GenericError", "desc": "Invalid node name"}} + +=== Send a write command to a drive opened in read-only mode (2) + +{"return": "Block node is read-onlyrn"} + +=== Run block-commit on base using the default filter node name + +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}} +{"return": {}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "job0"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "job0"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "job0", "len": 1048576, "offset": 1048576, "speed": 0, "type": "commit"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "job0"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} + +=== Send a write command to a drive opened in read-only mode (3) + +{"return": "Block node is read-onlyrn"} +*** done diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group index XXXXXXX..XXXXXXX 100644 --- a/tests/qemu-iotests/group +++ b/tests/qemu-iotests/group @@ -XXX,XX +XXX,XX @@ 246 rw auto quick 247 rw auto quick 248 rw auto quick +249 rw auto quick -- 2.20.1
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> qed_read_table and qed_write_table use coroutine-only interfaces but are not marked coroutine_fn. Happily, they are called only from coroutine context, so we only need to add missed markers. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> --- block/qed.h | 28 ++++++++++++++++------------ block/qed-check.c | 4 ++-- block/qed-table.c | 33 ++++++++++++++++++++------------- block/qed.c | 5 +++-- 4 files changed, 41 insertions(+), 29 deletions(-) diff --git a/block/qed.h b/block/qed.h index XXXXXXX..XXXXXXX 100644 --- a/block/qed.h +++ b/block/qed.h @@ -XXX,XX +XXX,XX @@ void qed_commit_l2_cache_entry(L2TableCache *l2_cache, CachedL2Table *l2_table); /** * Table I/O functions */ -int qed_read_l1_table_sync(BDRVQEDState *s); -int qed_write_l1_table(BDRVQEDState *s, unsigned int index, unsigned int n); -int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index, - unsigned int n); -int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, - uint64_t offset); -int qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offset); -int qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, - unsigned int index, unsigned int n, bool flush); -int qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *request, - unsigned int index, unsigned int n, bool flush); +int coroutine_fn qed_read_l1_table_sync(BDRVQEDState *s); +int coroutine_fn qed_write_l1_table(BDRVQEDState *s, unsigned int index, + unsigned int n); +int coroutine_fn qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index, + unsigned int n); +int coroutine_fn qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, + uint64_t offset); +int coroutine_fn qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, + uint64_t offset); +int coroutine_fn qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, + unsigned int index, unsigned int n, + bool flush); +int coroutine_fn qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *request, + unsigned int index, unsigned int n, + bool flush); /** * Cluster functions @@ -XXX,XX +XXX,XX @@ int coroutine_fn qed_find_cluster(BDRVQEDState *s, QEDRequest *request, /** * Consistency check */ -int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix); +int coroutine_fn qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix); QEDTable *qed_alloc_table(BDRVQEDState *s); diff --git a/block/qed-check.c b/block/qed-check.c index XXXXXXX..XXXXXXX 100644 --- a/block/qed-check.c +++ b/block/qed-check.c @@ -XXX,XX +XXX,XX @@ static unsigned int qed_check_l2_table(QEDCheck *check, QEDTable *table) /** * Descend tables and check each cluster is referenced once only */ -static int qed_check_l1_table(QEDCheck *check, QEDTable *table) +static int coroutine_fn qed_check_l1_table(QEDCheck *check, QEDTable *table) { BDRVQEDState *s = check->s; unsigned int i, num_invalid_l1 = 0; @@ -XXX,XX +XXX,XX @@ static void qed_check_mark_clean(BDRVQEDState *s, BdrvCheckResult *result) } /* Called with table_lock held. */ -int qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix) +int coroutine_fn qed_check(BDRVQEDState *s, BdrvCheckResult *result, bool fix) { QEDCheck check = { .s = s, diff --git a/block/qed-table.c b/block/qed-table.c index XXXXXXX..XXXXXXX 100644 --- a/block/qed-table.c +++ b/block/qed-table.c @@ -XXX,XX +XXX,XX @@ #include "qemu/bswap.h" /* Called with table_lock held. */ -static int qed_read_table(BDRVQEDState *s, uint64_t offset, QEDTable *table) +static int coroutine_fn qed_read_table(BDRVQEDState *s, uint64_t offset, + QEDTable *table) { unsigned int bytes = s->header.cluster_size * s->header.table_size; @@ -XXX,XX +XXX,XX @@ out: * * Called with table_lock held. */ -static int qed_write_table(BDRVQEDState *s, uint64_t offset, QEDTable *table, - unsigned int index, unsigned int n, bool flush) +static int coroutine_fn qed_write_table(BDRVQEDState *s, uint64_t offset, + QEDTable *table, unsigned int index, + unsigned int n, bool flush) { unsigned int sector_mask = BDRV_SECTOR_SIZE / sizeof(uint64_t) - 1; unsigned int start, end, i; @@ -XXX,XX +XXX,XX @@ out: return ret; } -int qed_read_l1_table_sync(BDRVQEDState *s) +int coroutine_fn qed_read_l1_table_sync(BDRVQEDState *s) { return qed_read_table(s, s->header.l1_table_offset, s->l1_table); } /* Called with table_lock held. */ -int qed_write_l1_table(BDRVQEDState *s, unsigned int index, unsigned int n) +int coroutine_fn qed_write_l1_table(BDRVQEDState *s, unsigned int index, + unsigned int n) { BLKDBG_EVENT(s->bs->file, BLKDBG_L1_UPDATE); return qed_write_table(s, s->header.l1_table_offset, s->l1_table, index, n, false); } -int qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index, - unsigned int n) +int coroutine_fn qed_write_l1_table_sync(BDRVQEDState *s, unsigned int index, + unsigned int n) { return qed_write_l1_table(s, index, n); } /* Called with table_lock held. */ -int qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offset) +int coroutine_fn qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, + uint64_t offset) { int ret; @@ -XXX,XX +XXX,XX @@ int qed_read_l2_table(BDRVQEDState *s, QEDRequest *request, uint64_t offset) return ret; } -int qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, uint64_t offset) +int coroutine_fn qed_read_l2_table_sync(BDRVQEDState *s, QEDRequest *request, + uint64_t offset) { return qed_read_l2_table(s, request, offset); } /* Called with table_lock held. */ -int qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, - unsigned int index, unsigned int n, bool flush) +int coroutine_fn qed_write_l2_table(BDRVQEDState *s, QEDRequest *request, + unsigned int index, unsigned int n, + bool flush) { BLKDBG_EVENT(s->bs->file, BLKDBG_L2_UPDATE); return qed_write_table(s, request->l2_table->offset, request->l2_table->table, index, n, flush); } -int qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *request, - unsigned int index, unsigned int n, bool flush) +int coroutine_fn qed_write_l2_table_sync(BDRVQEDState *s, QEDRequest *request, + unsigned int index, unsigned int n, + bool flush) { return qed_write_l2_table(s, request, index, n, flush); } diff --git a/block/qed.c b/block/qed.c index XXXXXXX..XXXXXXX 100644 --- a/block/qed.c +++ b/block/qed.c @@ -XXX,XX +XXX,XX @@ static void coroutine_fn bdrv_qed_co_invalidate_cache(BlockDriverState *bs, } } -static int bdrv_qed_co_check(BlockDriverState *bs, BdrvCheckResult *result, - BdrvCheckMode fix) +static int coroutine_fn bdrv_qed_co_check(BlockDriverState *bs, + BdrvCheckResult *result, + BdrvCheckMode fix) { BDRVQEDState *s = bs->opaque; int ret; -- 2.20.1
The following changes since commit 13356edb87506c148b163b8c7eb0695647d00c2a: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2023-01-24 09:45:33 +0000) are available in the Git repository at: https://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch changes up to d570177b50c389f379f93183155a27d44856ab46: qemu-img: Change info key names for protocol nodes (2023-02-01 16:52:33 +0100) v4: - Fixed the 'qemu-img-close-errors' test case to run only on Linux and only with the file protocol, use qemu-io instead of truncate v3: - Make the compiler happier on BSD and CentOS Stream 8 v2: - Rebased to resolve merge conflicts in coroutine.h ---------------------------------------------------------------- Block layer patches - qemu-img info: Show protocol-level information - Move more functions to coroutines - Make coroutine annotations ready for static analysis - qemu-img: Fix exit code for errors closing the image - qcow2 bitmaps: Fix theoretical corruption in error path - pflash: Only load non-zero parts of backend image to save memory - Code cleanup and test case improvements ---------------------------------------------------------------- Alberto Faria (2): coroutine: annotate coroutine_fn for libclang block: Add no_coroutine_fn and coroutine_mixed_fn marker Emanuele Giuseppe Esposito (14): block-coroutine-wrapper: support void functions block: Convert bdrv_io_plug() to co_wrapper block: Convert bdrv_io_unplug() to co_wrapper block: Convert bdrv_is_inserted() to co_wrapper block: Rename refresh_total_sectors to bdrv_refresh_total_sectors block: Convert bdrv_refresh_total_sectors() to co_wrapper_mixed block-backend: use bdrv_getlength instead of blk_getlength block: use bdrv_co_refresh_total_sectors when possible block: Convert bdrv_get_allocated_file_size() to co_wrapper block: Convert bdrv_get_info() to co_wrapper_mixed block: Convert bdrv_eject() to co_wrapper block: Convert bdrv_lock_medium() to co_wrapper block: Convert bdrv_debug_event() to co_wrapper_mixed block: Rename bdrv_load/save_vmstate() to bdrv_co_load/save_vmstate() Hanna Reitz (12): block: Improve empty format-specific info dump block/file: Add file-specific image info block/vmdk: Change extent info type block: Split BlockNodeInfo off of ImageInfo qemu-img: Use BlockNodeInfo block/qapi: Let bdrv_query_image_info() recurse block/qapi: Introduce BlockGraphInfo block/qapi: Add indentation to bdrv_node_info_dump() iotests: Filter child node information iotests/106, 214, 308: Read only one size line qemu-img: Let info print block graph qemu-img: Change info key names for protocol nodes Kevin Wolf (4): qcow2: Fix theoretical corruption in store_bitmap() error path qemu-img commit: Report errors while closing the image qemu-img bitmap: Report errors while closing the image qemu-iotests: Test qemu-img bitmap/commit exit code on error Paolo Bonzini (2): qemu-io: do not reinvent the blk_pwrite_zeroes wheel block: remove bdrv_coroutine_enter Philippe Mathieu-Daudé (1): block/nbd: Add missing <qemu/bswap.h> include Thomas Huth (2): tests/qemu-iotests/312: Mark "quorum" as required driver tests/qemu-iotests/262: Check for availability of "blkverify" first Xiang Zheng (1): pflash: Only read non-zero parts of backend image qapi/block-core.json | 123 +++++++- include/block/block-common.h | 11 +- include/block/block-io.h | 41 ++- include/block/block_int-common.h | 26 +- include/block/block_int-io.h | 5 +- include/block/nbd.h | 1 + include/block/qapi.h | 14 +- include/qemu/osdep.h | 44 +++ include/sysemu/block-backend-io.h | 31 +- block.c | 88 +++--- block/blkdebug.c | 11 +- block/blkio.c | 15 +- block/blklogwrites.c | 6 +- block/blkreplay.c | 6 +- block/blkverify.c | 6 +- block/block-backend.c | 38 +-- block/commit.c | 4 +- block/copy-on-read.c | 18 +- block/crypto.c | 14 +- block/curl.c | 10 +- block/file-posix.c | 137 +++++---- block/file-win32.c | 18 +- block/filter-compress.c | 20 +- block/gluster.c | 23 +- block/io.c | 76 ++--- block/iscsi.c | 17 +- block/mirror.c | 6 +- block/monitor/block-hmp-cmds.c | 2 +- block/nbd.c | 8 +- block/nfs.c | 4 +- block/null.c | 13 +- block/nvme.c | 14 +- block/preallocate.c | 16 +- block/qapi.c | 317 ++++++++++++++++----- block/qcow.c | 5 +- block/qcow2-bitmap.c | 5 +- block/qcow2-refcount.c | 2 +- block/qcow2.c | 17 +- block/qed.c | 11 +- block/quorum.c | 8 +- block/raw-format.c | 25 +- block/rbd.c | 9 +- block/replication.c | 6 +- block/ssh.c | 4 +- block/throttle.c | 6 +- block/vdi.c | 7 +- block/vhdx.c | 5 +- block/vmdk.c | 22 +- block/vpc.c | 5 +- blockdev.c | 8 +- hw/block/block.c | 36 ++- hw/scsi/scsi-disk.c | 5 + qemu-img.c | 100 +++++-- qemu-io-cmds.c | 62 +--- tests/unit/test-block-iothread.c | 3 + scripts/block-coroutine-wrapper.py | 20 +- tests/qemu-iotests/iotests.py | 18 +- block/meson.build | 1 + tests/qemu-iotests/065 | 2 +- tests/qemu-iotests/106 | 4 +- tests/qemu-iotests/214 | 6 +- tests/qemu-iotests/262 | 3 +- tests/qemu-iotests/302.out | 5 + tests/qemu-iotests/308 | 4 +- tests/qemu-iotests/312 | 1 + tests/qemu-iotests/common.filter | 22 +- tests/qemu-iotests/common.rc | 22 +- tests/qemu-iotests/tests/qemu-img-close-errors | 96 +++++++ tests/qemu-iotests/tests/qemu-img-close-errors.out | 23 ++ 69 files changed, 1209 insertions(+), 552 deletions(-) create mode 100755 tests/qemu-iotests/tests/qemu-img-close-errors create mode 100644 tests/qemu-iotests/tests/qemu-img-close-errors.out