From 058f8f16db0c1c528b665a6283457f019c8b0926 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 9 Aug 2012 13:05:56 +0100 Subject: block: add BLOCK_O_CHECK for qemu-img check Image formats with a dirty bit, like qed and qcow2, repair dirty image files upon open with BDRV_O_RDWR. Performing automatic repair when qemu-img check runs is not ideal because the bdrv_open() call repairs the image before the actual bdrv_check() call from qemu-img.c. Fix this "double repair" since it leads to confusing output from qemu-img check. Tell the block driver that this image is being opened just for bdrv_check(). This skips automatic repair and qemu-img.c can invoke it manually with bdrv_check(). Update the golden output for qemu-iotests 039 to reflect the new qemu-img check output. Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- tests/qemu-iotests/039.out | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/qemu-iotests') diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out index 155a05e..cb510d6 100644 --- a/tests/qemu-iotests/039.out +++ b/tests/qemu-iotests/039.out @@ -26,6 +26,12 @@ incompatible_features 0x1 == Repairing the image file must succeed == ERROR OFLAG_COPIED: offset=8000000000050000 refcount=0 Repairing cluster 5 refcount=0 reference=1 +The following inconsistencies were found and repaired: + + 0 leaked clusters + 1 corruptions + +Double checking the fixed image now... No errors were found on the image. incompatible_features 0x0 -- cgit v1.1