* [PATCH v2 3/5] iotests: Remove explicit checks for qemu_img() == 0
2022-03-04 19:47 [PATCH v2 0/5] iotests: add enhanced debugging info to qemu-img failures John Snow
2022-03-04 19:47 ` [PATCH v2 1/5] python/utils: add add_visual_margin() text decoration utility John Snow
2022-03-04 19:47 ` [PATCH v2 2/5] python/utils: add VerboseProcessError John Snow
@ 2022-03-04 19:47 ` John Snow
2022-03-04 20:23 ` Eric Blake
2022-03-04 19:47 ` [PATCH v2 4/5] iotests: make qemu_img raise on non-zero rc by default John Snow
2022-03-04 19:47 ` [PATCH v2 5/5] iotests: fortify compare_images() against crashes John Snow
4 siblings, 1 reply; 8+ messages in thread
From: John Snow @ 2022-03-04 19:47 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Thomas Huth, Beraldo Leal, qemu-block, Eric Blake,
Hanna Reitz, Cleber Rosa, John Snow
qemu_img() returning zero ought to be the rule, not the
exception. Remove all explicit checks against the condition in
preparation for making non-zero returns an Exception.
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/163 | 9 +++------
tests/qemu-iotests/216 | 6 +++---
tests/qemu-iotests/218 | 2 +-
tests/qemu-iotests/224 | 11 +++++------
tests/qemu-iotests/228 | 12 ++++++------
tests/qemu-iotests/257 | 3 +--
tests/qemu-iotests/258 | 4 ++--
tests/qemu-iotests/310 | 14 +++++++-------
tests/qemu-iotests/tests/block-status-cache | 3 +--
tests/qemu-iotests/tests/graph-changes-while-io | 7 +++----
tests/qemu-iotests/tests/image-fleecing | 4 ++--
tests/qemu-iotests/tests/mirror-ready-cancel-error | 6 ++----
tests/qemu-iotests/tests/mirror-top-perms | 3 +--
.../qemu-iotests/tests/remove-bitmap-from-backing | 8 ++++----
tests/qemu-iotests/tests/stream-error-on-reset | 4 ++--
15 files changed, 43 insertions(+), 53 deletions(-)
diff --git a/tests/qemu-iotests/163 b/tests/qemu-iotests/163
index b8bfc95358..e4cd4b230f 100755
--- a/tests/qemu-iotests/163
+++ b/tests/qemu-iotests/163
@@ -107,8 +107,7 @@ class ShrinkBaseClass(iotests.QMPTestCase):
if iotests.imgfmt == 'raw':
return
- self.assertEqual(qemu_img('check', test_img), 0,
- "Verifying image corruption")
+ qemu_img('check', test_img)
def test_empty_image(self):
qemu_img('resize', '-f', iotests.imgfmt, '--shrink', test_img,
@@ -130,8 +129,7 @@ class ShrinkBaseClass(iotests.QMPTestCase):
qemu_img('resize', '-f', iotests.imgfmt, '--shrink', test_img,
self.shrink_size)
- self.assertEqual(qemu_img("compare", test_img, check_img), 0,
- "Verifying image content")
+ qemu_img("compare", test_img, check_img)
self.image_verify()
@@ -146,8 +144,7 @@ class ShrinkBaseClass(iotests.QMPTestCase):
qemu_img('resize', '-f', iotests.imgfmt, '--shrink', test_img,
self.shrink_size)
- self.assertEqual(qemu_img("compare", test_img, check_img), 0,
- "Verifying image content")
+ qemu_img("compare", test_img, check_img)
self.image_verify()
diff --git a/tests/qemu-iotests/216 b/tests/qemu-iotests/216
index c02f8d2880..88b385afa3 100755
--- a/tests/qemu-iotests/216
+++ b/tests/qemu-iotests/216
@@ -51,10 +51,10 @@ with iotests.FilePath('base.img') as base_img_path, \
log('--- Setting up images ---')
log('')
- assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
+ qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M')
assert qemu_io_silent(base_img_path, '-c', 'write -P 1 0M 1M') == 0
- assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
- '-F', iotests.imgfmt, top_img_path) == 0
+ qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
+ '-F', iotests.imgfmt, top_img_path)
assert qemu_io_silent(top_img_path, '-c', 'write -P 2 1M 1M') == 0
log('Done')
diff --git a/tests/qemu-iotests/218 b/tests/qemu-iotests/218
index 4922b4d3b6..853ed52b34 100755
--- a/tests/qemu-iotests/218
+++ b/tests/qemu-iotests/218
@@ -145,7 +145,7 @@ log('')
with iotests.VM() as vm, \
iotests.FilePath('src.img') as src_img_path:
- assert qemu_img('create', '-f', iotests.imgfmt, src_img_path, '64M') == 0
+ qemu_img('create', '-f', iotests.imgfmt, src_img_path, '64M')
assert qemu_io_silent('-f', iotests.imgfmt, src_img_path,
'-c', 'write -P 42 0M 64M') == 0
diff --git a/tests/qemu-iotests/224 b/tests/qemu-iotests/224
index 38dd153625..c31c55b49d 100755
--- a/tests/qemu-iotests/224
+++ b/tests/qemu-iotests/224
@@ -47,12 +47,11 @@ for filter_node_name in False, True:
iotests.FilePath('top.img') as top_img_path, \
iotests.VM() as vm:
- assert qemu_img('create', '-f', iotests.imgfmt,
- base_img_path, '64M') == 0
- assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
- '-F', iotests.imgfmt, mid_img_path) == 0
- assert qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
- '-F', iotests.imgfmt, top_img_path) == 0
+ qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M')
+ qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
+ '-F', iotests.imgfmt, mid_img_path)
+ qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
+ '-F', iotests.imgfmt, top_img_path)
# Something to commit
assert qemu_io_silent(mid_img_path, '-c', 'write -P 1 0 1M') == 0
diff --git a/tests/qemu-iotests/228 b/tests/qemu-iotests/228
index a5eda2e149..f79bae0267 100755
--- a/tests/qemu-iotests/228
+++ b/tests/qemu-iotests/228
@@ -54,11 +54,11 @@ with iotests.FilePath('base.img') as base_img_path, \
iotests.FilePath('top.img') as top_img_path, \
iotests.VM() as vm:
- assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
+ qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M')
# Choose a funny way to describe the backing filename
- assert qemu_img('create', '-f', iotests.imgfmt, '-b',
- 'file:' + base_img_path, '-F', iotests.imgfmt,
- top_img_path) == 0
+ qemu_img('create', '-f', iotests.imgfmt, '-b',
+ 'file:' + base_img_path, '-F', iotests.imgfmt,
+ top_img_path)
vm.launch()
@@ -172,8 +172,8 @@ with iotests.FilePath('base.img') as base_img_path, \
# (because qemu cannot "canonicalize"/"resolve" the backing
# filename unless the backing file is opened implicitly with the
# overlay)
- assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
- '-F', iotests.imgfmt, top_img_path) == 0
+ qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
+ '-F', iotests.imgfmt, top_img_path)
# You can only reliably override backing options by using a node
# reference (or by specifying file.filename, but, well...)
diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257
index c72c82a171..fb5359c581 100755
--- a/tests/qemu-iotests/257
+++ b/tests/qemu-iotests/257
@@ -240,8 +240,7 @@ def compare_images(image, reference, baseimg=None, expected_match=True):
"""
expected_ret = 0 if expected_match else 1
if baseimg:
- assert qemu_img("rebase", "-u", "-b", baseimg, '-F', iotests.imgfmt,
- image) == 0
+ qemu_img("rebase", "-u", "-b", baseimg, '-F', iotests.imgfmt, image)
ret = qemu_img("compare", image, reference)
log('qemu_img compare "{:s}" "{:s}" ==> {:s}, {:s}'.format(
image, reference,
diff --git a/tests/qemu-iotests/258 b/tests/qemu-iotests/258
index a6618208a8..7798a04d7d 100755
--- a/tests/qemu-iotests/258
+++ b/tests/qemu-iotests/258
@@ -75,13 +75,13 @@ def test_concurrent_finish(write_to_stream_node):
# It is important to use raw for the base layer (so that
# permissions are just handed through to the protocol layer)
- assert qemu_img('create', '-f', 'raw', node0_path, '64M') == 0
+ qemu_img('create', '-f', 'raw', node0_path, '64M')
stream_throttle=None
commit_throttle=None
for path in [node1_path, node2_path, node3_path, node4_path]:
- assert qemu_img('create', '-f', iotests.imgfmt, path, '64M') == 0
+ qemu_img('create', '-f', iotests.imgfmt, path, '64M')
if write_to_stream_node:
# This is what (most of the time) makes commit finish
diff --git a/tests/qemu-iotests/310 b/tests/qemu-iotests/310
index 33c3411869..4e6d70e5ac 100755
--- a/tests/qemu-iotests/310
+++ b/tests/qemu-iotests/310
@@ -43,15 +43,15 @@ with iotests.FilePath('base.img') as base_img_path, \
log('--- Setting up images ---')
log('')
- assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
+ qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M')
assert qemu_io_silent(base_img_path, '-c', 'write -P 1 0M 1M') == 0
assert qemu_io_silent(base_img_path, '-c', 'write -P 1 3M 1M') == 0
- assert qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
- '-F', iotests.imgfmt, mid_img_path) == 0
+ qemu_img('create', '-f', iotests.imgfmt, '-b', base_img_path,
+ '-F', iotests.imgfmt, mid_img_path)
assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 2M 1M') == 0
assert qemu_io_silent(mid_img_path, '-c', 'write -P 3 4M 1M') == 0
- assert qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
- '-F', iotests.imgfmt, top_img_path) == 0
+ qemu_img('create', '-f', iotests.imgfmt, '-b', mid_img_path,
+ '-F', iotests.imgfmt, top_img_path)
assert qemu_io_silent(top_img_path, '-c', 'write -P 2 1M 1M') == 0
# 0 1 2 3 4
@@ -105,8 +105,8 @@ with iotests.FilePath('base.img') as base_img_path, \
log('')
# Detach backing to check that we can read the data from the top level now
- assert qemu_img('rebase', '-u', '-b', '', '-f', iotests.imgfmt,
- top_img_path) == 0
+ qemu_img('rebase', '-u', '-b', '', '-f', iotests.imgfmt,
+ top_img_path)
assert qemu_io_silent(top_img_path, '-c', 'read -P 0 0 1M') == 0
assert qemu_io_silent(top_img_path, '-c', 'read -P 2 1M 1M') == 0
diff --git a/tests/qemu-iotests/tests/block-status-cache b/tests/qemu-iotests/tests/block-status-cache
index 6fa10bb8f8..40e648e251 100755
--- a/tests/qemu-iotests/tests/block-status-cache
+++ b/tests/qemu-iotests/tests/block-status-cache
@@ -35,8 +35,7 @@ nbd_sock = os.path.join(iotests.sock_dir, 'nbd.sock')
class TestBscWithNbd(iotests.QMPTestCase):
def setUp(self) -> None:
"""Just create an empty image with a read-only NBD server on it"""
- assert qemu_img_create('-f', iotests.imgfmt, test_img,
- str(image_size)) == 0
+ qemu_img_create('-f', iotests.imgfmt, test_img, str(image_size))
# Pass --allocation-depth to enable the qemu:allocation-depth context,
# which we are going to query to provoke a block-status inquiry with
diff --git a/tests/qemu-iotests/tests/graph-changes-while-io b/tests/qemu-iotests/tests/graph-changes-while-io
index 567e8cf21e..7664f33689 100755
--- a/tests/qemu-iotests/tests/graph-changes-while-io
+++ b/tests/qemu-iotests/tests/graph-changes-while-io
@@ -34,16 +34,15 @@ def do_qemu_img_bench() -> None:
"""
Do some I/O requests on `nbd_sock`.
"""
- assert qemu_img('bench', '-f', 'raw', '-c', '2000000',
- f'nbd+unix:///node0?socket={nbd_sock}') == 0
+ qemu_img('bench', '-f', 'raw', '-c', '2000000',
+ f'nbd+unix:///node0?socket={nbd_sock}')
class TestGraphChangesWhileIO(QMPTestCase):
def setUp(self) -> None:
# Create an overlay that can be added at runtime on top of the
# null-co block node that will receive I/O
- assert qemu_img_create('-f', imgfmt, '-F', 'raw', '-b', 'null-co://',
- top) == 0
+ qemu_img_create('-f', imgfmt, '-F', 'raw', '-b', 'null-co://', top)
# QSD instance with a null-co block node in an I/O thread,
# exported over NBD (on `nbd_sock`, export name "node0")
diff --git a/tests/qemu-iotests/tests/image-fleecing b/tests/qemu-iotests/tests/image-fleecing
index a58b5a1781..ac8f19e506 100755
--- a/tests/qemu-iotests/tests/image-fleecing
+++ b/tests/qemu-iotests/tests/image-fleecing
@@ -53,8 +53,8 @@ def do_test(use_cbw, base_img_path, fleece_img_path, nbd_sock_path, vm):
log('--- Setting up images ---')
log('')
- assert qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M') == 0
- assert qemu_img('create', '-f', 'qcow2', fleece_img_path, '64M') == 0
+ qemu_img('create', '-f', iotests.imgfmt, base_img_path, '64M')
+ qemu_img('create', '-f', 'qcow2', fleece_img_path, '64M')
for p in patterns:
qemu_io('-f', iotests.imgfmt,
diff --git a/tests/qemu-iotests/tests/mirror-ready-cancel-error b/tests/qemu-iotests/tests/mirror-ready-cancel-error
index 770ffca379..1d0e333b5e 100755
--- a/tests/qemu-iotests/tests/mirror-ready-cancel-error
+++ b/tests/qemu-iotests/tests/mirror-ready-cancel-error
@@ -31,10 +31,8 @@ target = os.path.join(iotests.test_dir, 'target.img')
class TestMirrorReadyCancelError(iotests.QMPTestCase):
def setUp(self) -> None:
- assert iotests.qemu_img_create('-f', iotests.imgfmt, source,
- str(image_size)) == 0
- assert iotests.qemu_img_create('-f', iotests.imgfmt, target,
- str(image_size)) == 0
+ iotests.qemu_img_create('-f', iotests.imgfmt, source, str(image_size))
+ iotests.qemu_img_create('-f', iotests.imgfmt, target, str(image_size))
# Ensure that mirror will copy something before READY so the
# target format layer will forward the pre-READY flush to its
diff --git a/tests/qemu-iotests/tests/mirror-top-perms b/tests/qemu-iotests/tests/mirror-top-perms
index b5849978c4..6ac8d5efcc 100755
--- a/tests/qemu-iotests/tests/mirror-top-perms
+++ b/tests/qemu-iotests/tests/mirror-top-perms
@@ -34,8 +34,7 @@ source = os.path.join(iotests.test_dir, 'source.img')
class TestMirrorTopPerms(iotests.QMPTestCase):
def setUp(self):
- assert qemu_img('create', '-f', iotests.imgfmt, source,
- str(image_size)) == 0
+ qemu_img('create', '-f', iotests.imgfmt, source, str(image_size))
self.vm = iotests.VM()
self.vm.add_drive(source)
self.vm.add_blockdev(f'null-co,node-name=null,size={image_size}')
diff --git a/tests/qemu-iotests/tests/remove-bitmap-from-backing b/tests/qemu-iotests/tests/remove-bitmap-from-backing
index 3c397b08ea..fee3141340 100755
--- a/tests/qemu-iotests/tests/remove-bitmap-from-backing
+++ b/tests/qemu-iotests/tests/remove-bitmap-from-backing
@@ -27,11 +27,11 @@ iotests.script_initialize(supported_fmts=['qcow2'],
top, base = iotests.file_path('top', 'base')
size = '1M'
-assert qemu_img_create('-f', iotests.imgfmt, base, size) == 0
-assert qemu_img_create('-f', iotests.imgfmt, '-b', base,
- '-F', iotests.imgfmt, top, size) == 0
+qemu_img_create('-f', iotests.imgfmt, base, size)
+qemu_img_create('-f', iotests.imgfmt, '-b', base,
+ '-F', iotests.imgfmt, top, size)
-assert qemu_img('bitmap', '--add', base, 'bitmap0') == 0
+qemu_img('bitmap', '--add', base, 'bitmap0')
# Just assert that our method of checking bitmaps in the image works.
assert 'bitmaps' in qemu_img_pipe('info', base)
diff --git a/tests/qemu-iotests/tests/stream-error-on-reset b/tests/qemu-iotests/tests/stream-error-on-reset
index 7eaedb24d7..389ae822b8 100755
--- a/tests/qemu-iotests/tests/stream-error-on-reset
+++ b/tests/qemu-iotests/tests/stream-error-on-reset
@@ -54,9 +54,9 @@ class TestStreamErrorOnReset(QMPTestCase):
to it will result in an error
- top image is attached to a virtio-scsi device
"""
- assert qemu_img_create('-f', imgfmt, base, str(image_size)) == 0
+ qemu_img_create('-f', imgfmt, base, str(image_size))
assert qemu_io_silent('-c', f'write 0 {data_size}', base) == 0
- assert qemu_img_create('-f', imgfmt, top, str(image_size)) == 0
+ qemu_img_create('-f', imgfmt, top, str(image_size))
self.vm = iotests.VM()
self.vm.add_args('-accel', 'tcg') # Make throttling work properly
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/5] iotests: make qemu_img raise on non-zero rc by default
2022-03-04 19:47 [PATCH v2 0/5] iotests: add enhanced debugging info to qemu-img failures John Snow
` (2 preceding siblings ...)
2022-03-04 19:47 ` [PATCH v2 3/5] iotests: Remove explicit checks for qemu_img() == 0 John Snow
@ 2022-03-04 19:47 ` John Snow
2022-03-04 19:47 ` [PATCH v2 5/5] iotests: fortify compare_images() against crashes John Snow
4 siblings, 0 replies; 8+ messages in thread
From: John Snow @ 2022-03-04 19:47 UTC (permalink / raw)
To: qemu-devel
Cc: Kevin Wolf, Thomas Huth, Beraldo Leal, qemu-block, Eric Blake,
Hanna Reitz, Cleber Rosa, John Snow
re-write qemu_img() as a function that will by default raise a
VerboseProcessException (extended from CalledProcessException) on
non-zero return codes. This will produce a stack trace that will show
the command line arguments and return code from the failed process run.
Users that want something more flexible (there appears to be only one)
can use check=False and manage the return themselves. However, when the
return code is negative, the Exception will be raised no matter what.
This is done under the belief that there's no legitimate reason, even in
negative tests, to see a crash from qemu-img.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
tests/qemu-iotests/257 | 8 +++--
tests/qemu-iotests/iotests.py | 56 ++++++++++++++++++++++++++++++-----
2 files changed, 54 insertions(+), 10 deletions(-)
diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257
index fb5359c581..e7e7a2317e 100755
--- a/tests/qemu-iotests/257
+++ b/tests/qemu-iotests/257
@@ -241,11 +241,13 @@ def compare_images(image, reference, baseimg=None, expected_match=True):
expected_ret = 0 if expected_match else 1
if baseimg:
qemu_img("rebase", "-u", "-b", baseimg, '-F', iotests.imgfmt, image)
- ret = qemu_img("compare", image, reference)
+
+ sub = qemu_img("compare", image, reference, check=False)
+
log('qemu_img compare "{:s}" "{:s}" ==> {:s}, {:s}'.format(
image, reference,
- "Identical" if ret == 0 else "Mismatch",
- "OK!" if ret == expected_ret else "ERROR!"),
+ "Identical" if sub.returncode == 0 else "Mismatch",
+ "OK!" if sub.returncode == expected_ret else "ERROR!"),
filters=[iotests.filter_testfiles])
def test_bitmap_sync(bsync_mode, msync_mode='bitmap', failure=None):
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 6027780180..f97eeb5f91 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -37,9 +37,10 @@
from contextlib import contextmanager
+from qemu.aqmp.legacy import QEMUMonitorProtocol
from qemu.machine import qtest
from qemu.qmp import QMPMessage
-from qemu.aqmp.legacy import QEMUMonitorProtocol
+from qemu.utils import VerboseProcessError
# Use this logger for logging messages directly from the iotests module
logger = logging.getLogger('qemu.iotests')
@@ -216,9 +217,49 @@ def qemu_img_pipe_and_status(*args: str) -> Tuple[str, int]:
return qemu_tool_pipe_and_status('qemu-img', full_args,
drop_successful_output=is_create)
-def qemu_img(*args: str) -> int:
- '''Run qemu-img and return the exit code'''
- return qemu_img_pipe_and_status(*args)[1]
+def qemu_img(*args: str, check: bool = True, combine_stdio: bool = True
+ ) -> subprocess.CompletedProcess[str]:
+ """
+ Run qemu_img and return the status code and console output.
+
+ This function always prepends QEMU_IMG_OPTIONS and may further alter
+ the args for 'create' commands.
+
+ :param args: command-line arguments to qemu-img.
+ :param check: Enforce a return code of zero.
+ :param combine_stdio: set to False to keep stdout/stderr separated.
+
+ :raise VerboseProcessError:
+ When the return code is negative, or on any non-zero exit code
+ when 'check=True' was provided (the default). This exception has
+ 'stdout', 'stderr', and 'returncode' properties that may be
+ inspected to show greater detail. If this exception is not
+ handled, the command-line, return code, and all console output
+ will be included at the bottom of the stack trace.
+
+ :return: a CompletedProcess. This object has args, returncode, and
+ stdout properties. If streams are not combined, it will also
+ have a stderr property.
+ """
+ full_args = qemu_img_args + qemu_img_create_prepare_args(list(args))
+
+ subp = subprocess.run(
+ full_args,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT if combine_stdio else subprocess.PIPE,
+ universal_newlines=True,
+ check=False
+ )
+
+ if check and subp.returncode or (subp.returncode < 0):
+ raise VerboseProcessError(
+ subp.returncode, full_args,
+ output=subp.stdout,
+ stderr=subp.stderr,
+ )
+
+ return subp
+
def ordered_qmp(qmsg, conv_keys=True):
# Dictionaries are not ordered prior to 3.6, therefore:
@@ -233,7 +274,7 @@ def ordered_qmp(qmsg, conv_keys=True):
return od
return qmsg
-def qemu_img_create(*args):
+def qemu_img_create(*args: str) -> subprocess.CompletedProcess[str]:
return qemu_img('create', *args)
def qemu_img_measure(*args):
@@ -465,8 +506,9 @@ def qemu_nbd_popen(*args):
def compare_images(img1, img2, fmt1=imgfmt, fmt2=imgfmt):
'''Return True if two image files are identical'''
- return qemu_img('compare', '-f', fmt1,
- '-F', fmt2, img1, img2) == 0
+ res = qemu_img('compare', '-f', fmt1,
+ '-F', fmt2, img1, img2, check=False)
+ return res.returncode == 0
def create_image(name, size):
'''Create a fully-allocated raw image with sector markers'''
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread