Skip to contentSkip to conversation

qemu-iotests: 082: Filter the real disk size

PATCH Applied Michael Mueller 3 participants 3 messages Nov 27, 2014 – Dec 2, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-iotests: 082: Filter the real disk size

The real on-disk size of an image depends on things like the host filesystem. _img_info already filters it out, use the function in 082.

---
 tests/qemu-iotests/082     | 14 ++++++-------
 tests/qemu-iotests/082.out | 49 +++++++++++++---------------------------------
 2 files changed, 21 insertions(+), 42 deletions(-)
tests/qemu-iotests/082 +7 -7
index e64de27..c83e01e 100755
@@ -60,11 +60,11 @@ _img_info
 
 # Multiple -o should be merged
 run_qemu_img create -f $IMGFMT -o cluster_size=4k -o lazy_refcounts=on "$TEST_IMG" $size
-run_qemu_img info "$TEST_IMG"
+_img_info --format-specific
 
 # If the same -o key is specified more than once, the last one wins
 run_qemu_img create -f $IMGFMT -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k "$TEST_IMG" $size
-run_qemu_img info "$TEST_IMG"
+_img_info --format-specific
 run_qemu_img create -f $IMGFMT -o cluster_size=4k,cluster_size=8k "$TEST_IMG" $size
 _img_info
 
@@ -114,11 +114,11 @@ TEST_IMG="${TEST_IMG}.base" _img_info
 
 # Multiple -o should be merged
 run_qemu_img convert -O $IMGFMT -o cluster_size=4k -o lazy_refcounts=on "$TEST_IMG" "$TEST_IMG".base
-run_qemu_img info "$TEST_IMG".base
+TEST_IMG="${TEST_IMG}.base" _img_info --format-specific
 
 # If the same -o key is specified more than once, the last one wins
 run_qemu_img convert -O $IMGFMT -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k "$TEST_IMG" "$TEST_IMG".base
-run_qemu_img info "$TEST_IMG".base
+TEST_IMG="${TEST_IMG}.base" _img_info --format-specific
 run_qemu_img convert -O $IMGFMT -o cluster_size=4k,cluster_size=8k "$TEST_IMG" "$TEST_IMG".base
 TEST_IMG="${TEST_IMG}.base" _img_info
 
@@ -157,15 +157,15 @@ echo === amend: Options specified more than once ===
 
 # Last -f should win
 run_qemu_img amend -f foo -f $IMGFMT -o lazy_refcounts=on "$TEST_IMG"
-run_qemu_img info "$TEST_IMG"
+_img_info --format-specific
 
 # Multiple -o should be merged
 run_qemu_img amend -f $IMGFMT -o size=130M -o lazy_refcounts=off "$TEST_IMG"
-run_qemu_img info "$TEST_IMG"
+_img_info --format-specific
 
 # If the same -o key is specified more than once, the last one wins
 run_qemu_img amend -f $IMGFMT -o size=8M -o lazy_refcounts=on -o size=132M "$TEST_IMG"
-run_qemu_img info "$TEST_IMG"
+_img_info --format-specific
 run_qemu_img amend -f $IMGFMT -o size=4M,size=148M "$TEST_IMG"
 _img_info
 
tests/qemu-iotests/082.out +14 -35

98 lines not on this page · raw message

Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Michael Mueller

The real on-disk size of an image depends on things like the host filesystem. _img_info already filters it out, use the function in 082.

---
  tests/qemu-iotests/082     | 14 ++++++-------
  tests/qemu-iotests/082.out | 49 +++++++++++++---------------------------------
  2 files changed, 21 insertions(+), 42 deletions(-)

Ah, I knew there was some other test which called qemu-img info directly... Now I know why I didn't find anything by grepping for $QEMU_IMG info.