]> git.proxmox.com Git - mirror_qemu.git/commitdiff
iotests/common.rc: introduce _qcow2_dump_header helper
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 23 Dec 2021 16:01:38 +0000 (17:01 +0100)
committerHanna Reitz <hreitz@redhat.com>
Tue, 1 Feb 2022 09:51:39 +0000 (10:51 +0100)
We'll use it in tests instead of explicit qcow2.py. Then we are going
to add some filtering in _qcow2_dump_header.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20211223160144.1097696-14-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
tests/qemu-iotests/common.rc

index d8582454de0aa4c2c9cfba0f0ce4916519151083..5dea310ea08c2bca65a6e21cbb66664662486b95 100644 (file)
@@ -996,5 +996,15 @@ _require_one_device_of()
     _notrun "$* not available"
 }
 
+_qcow2_dump_header()
+{
+    img="$1"
+    if [ -z "$img" ]; then
+        img="$TEST_IMG"
+    fi
+
+    $PYTHON qcow2.py "$img" dump-header
+}
+
 # make sure this script returns success
 true