* [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2
@ 2014-09-30 19:31 Max Reitz
2014-09-30 19:31 ` [Qemu-devel] [PATCH 1/3] iotests: Use _img_info Max Reitz
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Max Reitz @ 2014-09-30 19:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Jeff Cody, Stefan Hajnoczi, Max Reitz
This series adds a field corresponding to the "corrupt" flag to
ImageInfoSpecificQCow2. This breaks several qemu-iotests which directly
invoke qemu-img info instead of using _img_info. Patch 1 tries to
minimize the necessary output fixes in patch 2 by replacing several
occurrences of direct qemu-img info calls by _img_info where
appropriate.
Max Reitz (3):
iotests: Use _img_info
qapi: Add corrupt field to ImageInfoSpecificQCow2
iotests: qemu-img info output for corrupt image
block/qcow2.c | 3 +++
qapi/block-core.json | 6 ++++-
tests/qemu-iotests/060 | 3 +++
tests/qemu-iotests/060.out | 9 +++++++
tests/qemu-iotests/065 | 12 ++++-----
tests/qemu-iotests/067.out | 10 ++++----
tests/qemu-iotests/070 | 2 +-
tests/qemu-iotests/070.out | 5 ++--
tests/qemu-iotests/082 | 12 ++++-----
tests/qemu-iotests/082.out | 62 ++++++++++++++--------------------------------
tests/qemu-iotests/089.out | 2 ++
tests/qemu-iotests/095 | 4 +--
tests/qemu-iotests/095.out | 16 +++---------
13 files changed, 66 insertions(+), 80 deletions(-)
--
2.1.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 1/3] iotests: Use _img_info
2014-09-30 19:31 [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2 Max Reitz
@ 2014-09-30 19:31 ` Max Reitz
2014-09-30 20:14 ` Eric Blake
2014-09-30 19:31 ` [Qemu-devel] [PATCH 2/3] qapi: Add corrupt field to ImageInfoSpecificQCow2 Max Reitz
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Max Reitz @ 2014-09-30 19:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Jeff Cody, Stefan Hajnoczi, Max Reitz
qemu-img info should only be used directly if the format-specific
information or the name of the format is relevant (some tests explicitly
test format-specific information; test 082 uses qcow2-specific settings
to test the qemu-img interface); otherwise, tests should always use
_img_info instead.
Test 082 was touched only partially. It does test the qemu-img
interface; however, its invocations of qemu-img info are not real tests
but rather verifications, so if format-specific information is not
important for the test, there is no reason not to use _img_info. In
contrast to directly invoking qemu-img info, "qcow2" is replaced by
"IMGFMT"; but as "qcow2" is only mentioned once in test 082 (in
_supported_fmt), I consider this an improvement.
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/070 | 2 +-
tests/qemu-iotests/070.out | 5 ++---
tests/qemu-iotests/082 | 12 +++++-----
tests/qemu-iotests/082.out | 55 ++++++++++------------------------------------
tests/qemu-iotests/095 | 4 ++--
tests/qemu-iotests/095.out | 16 ++++----------
6 files changed, 26 insertions(+), 68 deletions(-)
diff --git a/tests/qemu-iotests/070 b/tests/qemu-iotests/070
index ea0dae7..d649ddf 100755
--- a/tests/qemu-iotests/070
+++ b/tests/qemu-iotests/070
@@ -77,7 +77,7 @@ _use_sample_img test-disk2vhd.vhdx.bz2
echo
echo "=== Verify image created by Disk2VHD can be opened ==="
-$QEMU_IMG info "$TEST_IMG" 2>&1 | _filter_testdir | _filter_qemu
+_img_info
# success, all done
echo "*** done"
diff --git a/tests/qemu-iotests/070.out b/tests/qemu-iotests/070.out
index 15f1fc1..ca74383 100644
--- a/tests/qemu-iotests/070.out
+++ b/tests/qemu-iotests/070.out
@@ -20,9 +20,8 @@ read 18874368/18874368 bytes at offset 0
18 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
=== Verify image created by Disk2VHD can be opened ===
-image: TEST_DIR/test-disk2vhd.vhdx
-file format: vhdx
+image: TEST_DIR/test-disk2vhd.IMGFMT
+file format: IMGFMT
virtual size: 256M (268435456 bytes)
-disk size: 260M
cluster_size: 2097152
*** done
diff --git a/tests/qemu-iotests/082 b/tests/qemu-iotests/082
index f6eb75f..910b13e 100755
--- a/tests/qemu-iotests/082
+++ b/tests/qemu-iotests/082
@@ -56,7 +56,7 @@ echo === create: Options specified more than once ===
# Last -f should win
run_qemu_img create -f foo -f $IMGFMT "$TEST_IMG" $size
-run_qemu_img info "$TEST_IMG"
+_img_info
# Multiple -o should be merged
run_qemu_img create -f $IMGFMT -o cluster_size=4k -o lazy_refcounts=on "$TEST_IMG" $size
@@ -66,7 +66,7 @@ run_qemu_img info "$TEST_IMG"
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"
run_qemu_img create -f $IMGFMT -o cluster_size=4k,cluster_size=8k "$TEST_IMG" $size
-run_qemu_img info "$TEST_IMG"
+_img_info
echo
echo === create: help for -o ===
@@ -106,11 +106,11 @@ run_qemu_img create -f $IMGFMT "$TEST_IMG" $size
# Last -f should win
run_qemu_img convert -f foo -f $IMGFMT "$TEST_IMG" "$TEST_IMG".base
-run_qemu_img info "$TEST_IMG".base
+TEST_IMG="${TEST_IMG}.base" _img_info
# Last -O should win
run_qemu_img convert -O foo -O $IMGFMT "$TEST_IMG" "$TEST_IMG".base
-run_qemu_img info "$TEST_IMG".base
+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
@@ -120,7 +120,7 @@ run_qemu_img info "$TEST_IMG".base
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
run_qemu_img convert -O $IMGFMT -o cluster_size=4k,cluster_size=8k "$TEST_IMG" "$TEST_IMG".base
-run_qemu_img info "$TEST_IMG".base
+TEST_IMG="${TEST_IMG}.base" _img_info
echo
echo === convert: help for -o ===
@@ -167,7 +167,7 @@ run_qemu_img info "$TEST_IMG"
run_qemu_img amend -f $IMGFMT -o size=8M -o lazy_refcounts=on -o size=132M "$TEST_IMG"
run_qemu_img info "$TEST_IMG"
run_qemu_img amend -f $IMGFMT -o size=4M,size=148M "$TEST_IMG"
-run_qemu_img info "$TEST_IMG"
+_img_info
echo
echo === amend: help for -o ===
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index 90c21c8..249c5e4 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -4,16 +4,10 @@ QA output created by 082
Testing: create -f foo -f qcow2 TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 encryption=off cluster_size=65536 lazy_refcounts=off
-
-Testing: info TEST_DIR/t.qcow2
-image: TEST_DIR/t.qcow2
-file format: qcow2
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
virtual size: 128M (134217728 bytes)
-disk size: 196K
cluster_size: 65536
-Format specific information:
- compat: 1.1
- lazy refcounts: false
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 encryption=off cluster_size=4096 lazy_refcounts=on
@@ -43,16 +37,10 @@ Format specific information:
Testing: create -f qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 encryption=off cluster_size=8192 lazy_refcounts=off
-
-Testing: info TEST_DIR/t.qcow2
-image: TEST_DIR/t.qcow2
-file format: qcow2
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
virtual size: 128M (134217728 bytes)
-disk size: 28K
cluster_size: 8192
-Format specific information:
- compat: 1.1
- lazy refcounts: false
=== create: help for -o ===
@@ -188,24 +176,15 @@ Testing: create -f qcow2 TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 encryption=off cluster_size=65536 lazy_refcounts=off
Testing: convert -f foo -f qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
-
-Testing: info TEST_DIR/t.qcow2.base
-image: TEST_DIR/t.qcow2.base
+image: TEST_DIR/t.IMGFMT.base
file format: raw
virtual size: 128M (134217728 bytes)
-disk size: 0
Testing: convert -O foo -O qcow2 TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
-
-Testing: info TEST_DIR/t.qcow2.base
-image: TEST_DIR/t.qcow2.base
-file format: qcow2
+image: TEST_DIR/t.IMGFMT.base
+file format: IMGFMT
virtual size: 128M (134217728 bytes)
-disk size: 196K
cluster_size: 65536
-Format specific information:
- compat: 1.1
- lazy refcounts: false
Testing: convert -O qcow2 -o cluster_size=4k -o lazy_refcounts=on TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
@@ -232,16 +211,10 @@ Format specific information:
lazy refcounts: true
Testing: convert -O qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.base
-
-Testing: info TEST_DIR/t.qcow2.base
-image: TEST_DIR/t.qcow2.base
-file format: qcow2
+image: TEST_DIR/t.IMGFMT.base
+file format: IMGFMT
virtual size: 128M (134217728 bytes)
-disk size: 28K
cluster_size: 8192
-Format specific information:
- compat: 1.1
- lazy refcounts: false
=== convert: help for -o ===
@@ -410,16 +383,10 @@ Format specific information:
lazy refcounts: true
Testing: amend -f qcow2 -o size=4M,size=148M TEST_DIR/t.qcow2
-
-Testing: info TEST_DIR/t.qcow2
-image: TEST_DIR/t.qcow2
-file format: qcow2
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
virtual size: 148M (155189248 bytes)
-disk size: 196K
cluster_size: 65536
-Format specific information:
- compat: 1.1
- lazy refcounts: true
=== amend: help for -o ===
diff --git a/tests/qemu-iotests/095 b/tests/qemu-iotests/095
index acc7dbf..6630181 100755
--- a/tests/qemu-iotests/095
+++ b/tests/qemu-iotests/095
@@ -60,7 +60,7 @@ _make_test_img -b "${TEST_IMG}.snp1" $size_larger
echo
echo "=== Base image info before commit and resize ==="
-$QEMU_IMG info "${TEST_IMG}.base" | _filter_testdir
+TEST_IMG="${TEST_IMG}.base" _img_info
echo
echo === Running QEMU Live Commit Test ===
@@ -78,7 +78,7 @@ _send_qemu_cmd $h "{ 'execute': 'block-commit',
echo
echo "=== Base image info after commit and resize ==="
-$QEMU_IMG info "${TEST_IMG}.base" | _filter_testdir
+TEST_IMG="${TEST_IMG}.base" _img_info
# success, all done
echo "*** done"
diff --git a/tests/qemu-iotests/095.out b/tests/qemu-iotests/095.out
index 5864dda..cc86efa 100644
--- a/tests/qemu-iotests/095.out
+++ b/tests/qemu-iotests/095.out
@@ -4,14 +4,10 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file='TEST_DIR
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=104857600 backing_file='TEST_DIR/t.IMGFMT.snp1'
=== Base image info before commit and resize ===
-image: TEST_DIR/t.qcow2.base
-file format: qcow2
+image: TEST_DIR/t.IMGFMT.base
+file format: IMGFMT
virtual size: 5.0M (5242880 bytes)
-disk size: 196K
cluster_size: 65536
-Format specific information:
- compat: 1.1
- lazy refcounts: false
=== Running QEMU Live Commit Test ===
@@ -20,12 +16,8 @@ Format specific information:
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "test", "len": 104857600, "offset": 104857600, "speed": 0, "type": "commit"}}
=== Base image info after commit and resize ===
-image: TEST_DIR/t.qcow2.base
-file format: qcow2
+image: TEST_DIR/t.IMGFMT.base
+file format: IMGFMT
virtual size: 100M (104857600 bytes)
-disk size: 196K
cluster_size: 65536
-Format specific information:
- compat: 1.1
- lazy refcounts: false
*** done
--
2.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 2/3] qapi: Add corrupt field to ImageInfoSpecificQCow2
2014-09-30 19:31 [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2 Max Reitz
2014-09-30 19:31 ` [Qemu-devel] [PATCH 1/3] iotests: Use _img_info Max Reitz
@ 2014-09-30 19:31 ` Max Reitz
2014-09-30 20:17 ` Eric Blake
2014-09-30 19:31 ` [Qemu-devel] [PATCH 3/3] iotests: qemu-img info output for corrupt image Max Reitz
2014-10-04 18:18 ` [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2 Stefan Hajnoczi
3 siblings, 1 reply; 8+ messages in thread
From: Max Reitz @ 2014-09-30 19:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Jeff Cody, Stefan Hajnoczi, Max Reitz
Just like lazy-refcounts, this field will be present iff the qcow2
compat level is 1.1 (or probably any future revision).
As expected, this breaks some tests due to the new field present in
qemu-img info output; so fix their output accordingly.
Suggested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
block/qcow2.c | 3 +++
qapi/block-core.json | 6 +++++-
tests/qemu-iotests/065 | 12 ++++++------
tests/qemu-iotests/067.out | 10 +++++-----
tests/qemu-iotests/082.out | 7 +++++++
tests/qemu-iotests/089.out | 2 ++
6 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 778fc1e..fb28493 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2282,6 +2282,9 @@ static ImageInfoSpecific *qcow2_get_specific_info(BlockDriverState *bs)
.lazy_refcounts = s->compatible_features &
QCOW2_COMPAT_LAZY_REFCOUNTS,
.has_lazy_refcounts = true,
+ .corrupt = s->incompatible_features &
+ QCOW2_INCOMPAT_CORRUPT,
+ .has_corrupt = true,
};
}
diff --git a/qapi/block-core.json b/qapi/block-core.json
index fa2d1b7..8f7089e 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -38,12 +38,16 @@
#
# @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
#
+# @corrupt: #optional true if the image has been marked corrupt; only valid for
+# compat >= 1.1 (since 2.2)
+#
# Since: 1.7
##
{ 'type': 'ImageInfoSpecificQCow2',
'data': {
'compat': 'str',
- '*lazy-refcounts': 'bool'
+ '*lazy-refcounts': 'bool',
+ '*corrupt': 'bool'
} }
##
diff --git a/tests/qemu-iotests/065 b/tests/qemu-iotests/065
index e89b61d..8d3a9c9 100755
--- a/tests/qemu-iotests/065
+++ b/tests/qemu-iotests/065
@@ -94,28 +94,28 @@ class TestQCow2(TestQemuImgInfo):
class TestQCow3NotLazy(TestQemuImgInfo):
'''Testing a qcow2 version 3 image with lazy refcounts disabled'''
img_options = 'compat=1.1,lazy_refcounts=off'
- json_compare = { 'compat': '1.1', 'lazy-refcounts': False }
- human_compare = [ 'compat: 1.1', 'lazy refcounts: false' ]
+ json_compare = { 'compat': '1.1', 'lazy-refcounts': False, 'corrupt': False }
+ human_compare = [ 'compat: 1.1', 'lazy refcounts: false', 'corrupt: false' ]
class TestQCow3Lazy(TestQemuImgInfo):
'''Testing a qcow2 version 3 image with lazy refcounts enabled'''
img_options = 'compat=1.1,lazy_refcounts=on'
- json_compare = { 'compat': '1.1', 'lazy-refcounts': True }
- human_compare = [ 'compat: 1.1', 'lazy refcounts: true' ]
+ json_compare = { 'compat': '1.1', 'lazy-refcounts': True, 'corrupt': False }
+ human_compare = [ 'compat: 1.1', 'lazy refcounts: true', 'corrupt: false' ]
class TestQCow3NotLazyQMP(TestQMP):
'''Testing a qcow2 version 3 image with lazy refcounts disabled, opening
with lazy refcounts enabled'''
img_options = 'compat=1.1,lazy_refcounts=off'
qemu_options = 'lazy-refcounts=on'
- compare = { 'compat': '1.1', 'lazy-refcounts': False }
+ compare = { 'compat': '1.1', 'lazy-refcounts': False, 'corrupt': False }
class TestQCow3LazyQMP(TestQMP):
'''Testing a qcow2 version 3 image with lazy refcounts enabled, opening
with lazy refcounts disabled'''
img_options = 'compat=1.1,lazy_refcounts=on'
qemu_options = 'lazy-refcounts=off'
- compare = { 'compat': '1.1', 'lazy-refcounts': True }
+ compare = { 'compat': '1.1', 'lazy-refcounts': True, 'corrupt': False }
TestImageInfoSpecific = None
TestQemuImgInfo = None
diff --git a/tests/qemu-iotests/067.out b/tests/qemu-iotests/067.out
index 7e090b9..0f72dcf 100644
--- a/tests/qemu-iotests/067.out
+++ b/tests/qemu-iotests/067.out
@@ -6,7 +6,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk -device virtio-blk-pci,drive=disk,id=virtio0
QMP_VERSION
{"return": {}}
-{"return": [{"io-status": "ok", "device": "disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}]}
+{"return": [{"io-status": "ok", "device": "disk", "locked": false, "removable": false, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}]}
{"return": {}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/virtio0/virtio-backend"}}
@@ -24,7 +24,7 @@ QMP_VERSION
Testing: -drive file=TEST_DIR/t.qcow2,format=qcow2,if=none,id=disk
QMP_VERSION
{"return": {}}
-{"return": [{"device": "disk", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}]}
+{"return": [{"device": "disk", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}, {"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}]}
{"return": {}}
{"return": {}}
{"return": {}}
@@ -44,7 +44,7 @@ Testing:
QMP_VERSION
{"return": {}}
{"return": "OK\r\n"}
-{"return": [{"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "disk", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}]}
+{"return": [{"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "disk", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}]}
{"return": {}}
{"return": {}}
{"return": {}}
@@ -64,14 +64,14 @@ Testing:
QMP_VERSION
{"return": {}}
{"return": {}}
-{"return": [{"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "disk", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}]}
+{"return": [{"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "disk", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}]}
{"return": {}}
{"return": {}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_DELETED", "data": {"path": "/machine/peripheral/virtio0/virtio-backend"}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_DELETED", "data": {"device": "virtio0", "path": "/machine/peripheral/virtio0"}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "RESET"}
-{"return": [{"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"io-status": "ok", "device": "disk", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}]}
+{"return": [{"io-status": "ok", "device": "ide1-cd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "floppy0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"device": "sd0", "locked": false, "removable": true, "tray_open": false, "type": "unknown"}, {"io-status": "ok", "device": "disk", "locked": false, "removable": true, "inserted": {"iops_rd": 0, "detect_zeroes": "off", "image": {"virtual-size": 134217728, "filename": "TEST_DIR/t.qcow2", "cluster-size": 65536, "format": "qcow2", "actual-size": SIZE, "format-specific": {"type": "qcow2", "data": {"compat": "1.1", "lazy-refcounts": false, "corrupt": false}}, "dirty-flag": false}, "iops_wr": 0, "ro": false, "backing_file_depth": 0, "drv": "qcow2", "iops": 0, "bps_wr": 0, "encrypted": false, "bps": 0, "bps_rd": 0, "file": "TEST_DIR/t.qcow2", "encryption_key_missing": false}, "tray_open": false, "type": "unknown"}]}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
diff --git a/tests/qemu-iotests/082.out b/tests/qemu-iotests/082.out
index 249c5e4..0a3ab5a 100644
--- a/tests/qemu-iotests/082.out
+++ b/tests/qemu-iotests/082.out
@@ -21,6 +21,7 @@ cluster_size: 4096
Format specific information:
compat: 1.1
lazy refcounts: true
+ corrupt: false
Testing: create -f qcow2 -o cluster_size=4k -o lazy_refcounts=on -o cluster_size=8k TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 encryption=off cluster_size=8192 lazy_refcounts=on
@@ -34,6 +35,7 @@ cluster_size: 8192
Format specific information:
compat: 1.1
lazy refcounts: true
+ corrupt: false
Testing: create -f qcow2 -o cluster_size=4k,cluster_size=8k TEST_DIR/t.qcow2 128M
Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=134217728 encryption=off cluster_size=8192 lazy_refcounts=off
@@ -197,6 +199,7 @@ cluster_size: 4096
Format specific information:
compat: 1.1
lazy refcounts: true
+ corrupt: false
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
@@ -209,6 +212,7 @@ cluster_size: 8192
Format specific information:
compat: 1.1
lazy refcounts: true
+ corrupt: false
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
@@ -357,6 +361,7 @@ cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
+ corrupt: false
Testing: amend -f qcow2 -o size=130M -o lazy_refcounts=off TEST_DIR/t.qcow2
@@ -369,6 +374,7 @@ cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
+ corrupt: false
Testing: amend -f qcow2 -o size=8M -o lazy_refcounts=on -o size=132M TEST_DIR/t.qcow2
@@ -381,6 +387,7 @@ cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
+ corrupt: false
Testing: amend -f qcow2 -o size=4M,size=148M TEST_DIR/t.qcow2
image: TEST_DIR/t.IMGFMT
diff --git a/tests/qemu-iotests/089.out b/tests/qemu-iotests/089.out
index 4ca2f88..b2b0390 100644
--- a/tests/qemu-iotests/089.out
+++ b/tests/qemu-iotests/089.out
@@ -41,10 +41,12 @@ vm state offset: 512 MiB
Format specific information:
compat: 1.1
lazy refcounts: false
+ corrupt: false
format name: IMGFMT
cluster size: 64 KiB
vm state offset: 512 MiB
Format specific information:
compat: 1.1
lazy refcounts: false
+ corrupt: false
*** done
--
2.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH 3/3] iotests: qemu-img info output for corrupt image
2014-09-30 19:31 [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2 Max Reitz
2014-09-30 19:31 ` [Qemu-devel] [PATCH 1/3] iotests: Use _img_info Max Reitz
2014-09-30 19:31 ` [Qemu-devel] [PATCH 2/3] qapi: Add corrupt field to ImageInfoSpecificQCow2 Max Reitz
@ 2014-09-30 19:31 ` Max Reitz
2014-09-30 20:21 ` Eric Blake
2014-10-04 18:18 ` [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2 Stefan Hajnoczi
3 siblings, 1 reply; 8+ messages in thread
From: Max Reitz @ 2014-09-30 19:31 UTC (permalink / raw)
To: qemu-devel; +Cc: Kevin Wolf, Jeff Cody, Stefan Hajnoczi, Max Reitz
The "corrupt" entry in the format-specific information section should be
"true".
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
tests/qemu-iotests/060 | 3 +++
tests/qemu-iotests/060.out | 9 +++++++++
2 files changed, 12 insertions(+)
diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index 2355567..9772d36 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -76,6 +76,9 @@ $QEMU_IO -c "$OPEN_RW" -c "write -P 0x2a 0 512" | _filter_qemu_io
# The corrupt bit must now be set
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
+# This information should be available through qemu-img info
+$QEMU_IMG info "$TEST_IMG" | _filter_testdir
+
# Try to open the image R/W (which should fail)
$QEMU_IO -c "$OPEN_RW" -c "read 0 512" 2>&1 | _filter_qemu_io \
| _filter_testdir \
diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
index 4f0c6d0..cd679f9 100644
--- a/tests/qemu-iotests/060.out
+++ b/tests/qemu-iotests/060.out
@@ -11,6 +11,15 @@ incompatible_features 0x0
qcow2: Marking image as corrupt: Preventing invalid write on metadata (overlaps with active L1 table); further corruption events will be suppressed
write failed: Input/output error
incompatible_features 0x2
+image: TEST_DIR/t.qcow2
+file format: qcow2
+virtual size: 64M (67108864 bytes)
+disk size: 196K
+cluster_size: 65536
+Format specific information:
+ compat: 1.1
+ lazy refcounts: false
+ corrupt: true
qemu-io: can't open device TEST_DIR/t.IMGFMT: IMGFMT: Image is corrupt; cannot be opened read/write
read 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
--
2.1.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] iotests: Use _img_info
2014-09-30 19:31 ` [Qemu-devel] [PATCH 1/3] iotests: Use _img_info Max Reitz
@ 2014-09-30 20:14 ` Eric Blake
0 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2014-09-30 20:14 UTC (permalink / raw)
To: Max Reitz, qemu-devel; +Cc: Kevin Wolf, Jeff Cody, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]
On 09/30/2014 01:31 PM, Max Reitz wrote:
> qemu-img info should only be used directly if the format-specific
> information or the name of the format is relevant (some tests explicitly
> test format-specific information; test 082 uses qcow2-specific settings
> to test the qemu-img interface); otherwise, tests should always use
> _img_info instead.
>
> Test 082 was touched only partially. It does test the qemu-img
> interface; however, its invocations of qemu-img info are not real tests
> but rather verifications, so if format-specific information is not
> important for the test, there is no reason not to use _img_info. In
> contrast to directly invoking qemu-img info, "qcow2" is replaced by
> "IMGFMT"; but as "qcow2" is only mentioned once in test 082 (in
> _supported_fmt), I consider this an improvement.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> tests/qemu-iotests/070 | 2 +-
> tests/qemu-iotests/070.out | 5 ++---
> tests/qemu-iotests/082 | 12 +++++-----
> tests/qemu-iotests/082.out | 55 ++++++++++------------------------------------
> tests/qemu-iotests/095 | 4 ++--
> tests/qemu-iotests/095.out | 16 ++++----------
> 6 files changed, 26 insertions(+), 68 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 2/3] qapi: Add corrupt field to ImageInfoSpecificQCow2
2014-09-30 19:31 ` [Qemu-devel] [PATCH 2/3] qapi: Add corrupt field to ImageInfoSpecificQCow2 Max Reitz
@ 2014-09-30 20:17 ` Eric Blake
0 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2014-09-30 20:17 UTC (permalink / raw)
To: Max Reitz, qemu-devel; +Cc: Kevin Wolf, Jeff Cody, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 954 bytes --]
On 09/30/2014 01:31 PM, Max Reitz wrote:
> Just like lazy-refcounts, this field will be present iff the qcow2
> compat level is 1.1 (or probably any future revision).
>
> As expected, this breaks some tests due to the new field present in
> qemu-img info output; so fix their output accordingly.
>
> Suggested-by: Eric Blake <eblake@redhat.com>
Thanks for tackling this :)
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> block/qcow2.c | 3 +++
> qapi/block-core.json | 6 +++++-
> tests/qemu-iotests/065 | 12 ++++++------
> tests/qemu-iotests/067.out | 10 +++++-----
> tests/qemu-iotests/082.out | 7 +++++++
> tests/qemu-iotests/089.out | 2 ++
> 6 files changed, 28 insertions(+), 12 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
(those are some long lines!)
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 3/3] iotests: qemu-img info output for corrupt image
2014-09-30 19:31 ` [Qemu-devel] [PATCH 3/3] iotests: qemu-img info output for corrupt image Max Reitz
@ 2014-09-30 20:21 ` Eric Blake
0 siblings, 0 replies; 8+ messages in thread
From: Eric Blake @ 2014-09-30 20:21 UTC (permalink / raw)
To: Max Reitz, qemu-devel; +Cc: Kevin Wolf, Jeff Cody, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 472 bytes --]
On 09/30/2014 01:31 PM, Max Reitz wrote:
> The "corrupt" entry in the format-specific information section should be
> "true".
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> tests/qemu-iotests/060 | 3 +++
> tests/qemu-iotests/060.out | 9 +++++++++
> 2 files changed, 12 insertions(+)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2
2014-09-30 19:31 [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2 Max Reitz
` (2 preceding siblings ...)
2014-09-30 19:31 ` [Qemu-devel] [PATCH 3/3] iotests: qemu-img info output for corrupt image Max Reitz
@ 2014-10-04 18:18 ` Stefan Hajnoczi
3 siblings, 0 replies; 8+ messages in thread
From: Stefan Hajnoczi @ 2014-10-04 18:18 UTC (permalink / raw)
To: Max Reitz; +Cc: Kevin Wolf, Jeff Cody, qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 1361 bytes --]
On Tue, Sep 30, 2014 at 09:31:26PM +0200, Max Reitz wrote:
> This series adds a field corresponding to the "corrupt" flag to
> ImageInfoSpecificQCow2. This breaks several qemu-iotests which directly
> invoke qemu-img info instead of using _img_info. Patch 1 tries to
> minimize the necessary output fixes in patch 2 by replacing several
> occurrences of direct qemu-img info calls by _img_info where
> appropriate.
>
>
> Max Reitz (3):
> iotests: Use _img_info
> qapi: Add corrupt field to ImageInfoSpecificQCow2
> iotests: qemu-img info output for corrupt image
>
> block/qcow2.c | 3 +++
> qapi/block-core.json | 6 ++++-
> tests/qemu-iotests/060 | 3 +++
> tests/qemu-iotests/060.out | 9 +++++++
> tests/qemu-iotests/065 | 12 ++++-----
> tests/qemu-iotests/067.out | 10 ++++----
> tests/qemu-iotests/070 | 2 +-
> tests/qemu-iotests/070.out | 5 ++--
> tests/qemu-iotests/082 | 12 ++++-----
> tests/qemu-iotests/082.out | 62 ++++++++++++++--------------------------------
> tests/qemu-iotests/089.out | 2 ++
> tests/qemu-iotests/095 | 4 +--
> tests/qemu-iotests/095.out | 16 +++---------
> 13 files changed, 66 insertions(+), 80 deletions(-)
>
> --
> 2.1.1
>
>
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-10-04 18:18 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30 19:31 [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2 Max Reitz
2014-09-30 19:31 ` [Qemu-devel] [PATCH 1/3] iotests: Use _img_info Max Reitz
2014-09-30 20:14 ` Eric Blake
2014-09-30 19:31 ` [Qemu-devel] [PATCH 2/3] qapi: Add corrupt field to ImageInfoSpecificQCow2 Max Reitz
2014-09-30 20:17 ` Eric Blake
2014-09-30 19:31 ` [Qemu-devel] [PATCH 3/3] iotests: qemu-img info output for corrupt image Max Reitz
2014-09-30 20:21 ` Eric Blake
2014-10-04 18:18 ` [Qemu-devel] [PATCH 0/3] qcow2/qapi: Add "corrupt" to ImageInfoSpecificQCow2 Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).