* [Qemu-devel] [PATCH] qemu-iotests: 060: Filter the real disk size
@ 2014-11-27 14:08 Kevin Wolf
2014-11-27 14:24 ` Max Reitz
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kevin Wolf @ 2014-11-27 14:08 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, maochuan, mimu, stefanha, mreitz
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 060.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
tests/qemu-iotests/060 | 2 +-
tests/qemu-iotests/060.out | 5 ++---
tests/qemu-iotests/common.rc | 11 ++++++++++-
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index 9772d36..73863bf 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -77,7 +77,7 @@ $QEMU_IO -c "$OPEN_RW" -c "write -P 0x2a 0 512" | _filter_qemu_io
$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
+_img_info --format-specific
# Try to open the image R/W (which should fail)
$QEMU_IO -c "$OPEN_RW" -c "read 0 512" 2>&1 | _filter_qemu_io \
diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
index 9419da1..4cdf62b 100644
--- a/tests/qemu-iotests/060.out
+++ b/tests/qemu-iotests/060.out
@@ -11,10 +11,9 @@ 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
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
virtual size: 64M (67108864 bytes)
-disk size: 196K
cluster_size: 65536
Format specific information:
compat: 1.1
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 9c49deb..89cbc13 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -213,6 +213,13 @@ _check_test_img()
_img_info()
{
+ if [[ "$1" == "--format-specific" ]]; then
+ local format_specific=1
+ shift
+ else
+ local format_specific=0
+ fi
+
discard=0
regex_json_spec_start='^ *"format-specific": \{'
$QEMU_IMG info "$@" "$TEST_IMG" 2>&1 | \
@@ -222,7 +229,9 @@ _img_info()
-e "/^disk size:/ D" \
-e "/actual-size/ D" | \
while IFS='' read line; do
- if [[ $line == "Format specific information:" ]]; then
+ if [[ $format_specific == 1 ]]; then
+ discard=0
+ elif [[ $line == "Format specific information:" ]]; then
discard=1
elif [[ $line =~ $regex_json_spec_start ]]; then
discard=2
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-iotests: 060: Filter the real disk size
2014-11-27 14:08 [Qemu-devel] [PATCH] qemu-iotests: 060: Filter the real disk size Kevin Wolf
@ 2014-11-27 14:24 ` Max Reitz
2014-11-27 16:30 ` Michael Mueller
2014-12-02 10:24 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Max Reitz @ 2014-11-27 14:24 UTC (permalink / raw)
To: Kevin Wolf, qemu-devel; +Cc: maochuan, mimu, stefanha
On 2014-11-27 at 15:08, Kevin Wolf wrote:
> 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 060.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> tests/qemu-iotests/060 | 2 +-
> tests/qemu-iotests/060.out | 5 ++---
> tests/qemu-iotests/common.rc | 11 ++++++++++-
> 3 files changed, 13 insertions(+), 5 deletions(-)
Reviewed-by: Max Reitz <mreitz@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-iotests: 060: Filter the real disk size
2014-11-27 14:08 [Qemu-devel] [PATCH] qemu-iotests: 060: Filter the real disk size Kevin Wolf
2014-11-27 14:24 ` Max Reitz
@ 2014-11-27 16:30 ` Michael Mueller
2014-12-02 10:24 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Michael Mueller @ 2014-11-27 16:30 UTC (permalink / raw)
To: Kevin Wolf; +Cc: maochuan, qemu-devel, stefanha, mreitz
On Thu, 27 Nov 2014 15:08:07 +0100
Kevin Wolf <kwolf@redhat.com> wrote:
> 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 060.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> tests/qemu-iotests/060 | 2 +-
> tests/qemu-iotests/060.out | 5 ++---
> tests/qemu-iotests/common.rc | 11 ++++++++++-
> 3 files changed, 13 insertions(+), 5 deletions(-)
Reviewed-by: Michael Mueller <mimu@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] qemu-iotests: 060: Filter the real disk size
2014-11-27 14:08 [Qemu-devel] [PATCH] qemu-iotests: 060: Filter the real disk size Kevin Wolf
2014-11-27 14:24 ` Max Reitz
2014-11-27 16:30 ` Michael Mueller
@ 2014-12-02 10:24 ` Kevin Wolf
2 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2014-12-02 10:24 UTC (permalink / raw)
To: qemu-devel; +Cc: maochuan, mimu, stefanha, mreitz
Am 27.11.2014 um 15:08 hat Kevin Wolf geschrieben:
> 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 060.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Applied to block-next.
Kevin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-12-02 10:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-27 14:08 [Qemu-devel] [PATCH] qemu-iotests: 060: Filter the real disk size Kevin Wolf
2014-11-27 14:24 ` Max Reitz
2014-11-27 16:30 ` Michael Mueller
2014-12-02 10:24 ` Kevin Wolf
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).