From: "Denis V. Lunev" <den@openvz.org>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, "Denis V. Lunev" <den@openvz.org>,
John Snow <jsnow@redhat.com>, Thomas Huth <thuth@redhat.com>
Subject: [PATCH 1/7] tests/qtest/libqos: let mkqcow2() report failure
Date: Mon, 24 Aug 2026 22:06:21 +0200 [thread overview]
Message-ID: <20260824200627.2180635-2-den@openvz.org> (raw)
In-Reply-To: <CAFn=p-bCR4TvVvHwagXiK-c0wuY5dACwh92249Wv0C3odCtbOg@mail.gmail.com>
From: Denis V. Lunev <den@openvz.org>
mkqcow2() asserts that qemu-img succeeded, so a caller that has
qemu-img but cannot use it aborts the binary rather than skipping.
Return the result instead. virtio-scsi-test takes the skip path it
already has for a missing qemu-img; ahci-test grows one two patches
on.
Cc: John Snow <jsnow@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
tests/qtest/libqos/libqos.c | 4 ++--
tests/qtest/libqos/libqos.h | 2 +-
tests/qtest/virtio-scsi-test.c | 5 ++++-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/tests/qtest/libqos/libqos.c b/tests/qtest/libqos/libqos.c
index 9b49d0d4dd..ff0d595346 100644
--- a/tests/qtest/libqos/libqos.c
+++ b/tests/qtest/libqos/libqos.c
@@ -138,9 +138,9 @@ void migrate(QOSState *from, QOSState *to, const char *uri)
migrate_allocator(&from->alloc, &to->alloc);
}
-void mkqcow2(const char *file, unsigned size_mb)
+bool mkqcow2(const char *file, unsigned size_mb)
{
- g_assert_true(mkimg(file, "qcow2", size_mb));
+ return mkimg(file, "qcow2", size_mb);
}
void prepare_blkdebug_script(const char *debug_fn, const char *event)
diff --git a/tests/qtest/libqos/libqos.h b/tests/qtest/libqos/libqos.h
index c04950e2b1..8390d4fa98 100644
--- a/tests/qtest/libqos/libqos.h
+++ b/tests/qtest/libqos/libqos.h
@@ -27,7 +27,7 @@ QOSState *qtest_boot(QOSOps *ops, const char *cmdline_fmt, ...)
G_GNUC_PRINTF(2, 3);
void qtest_common_shutdown(QOSState *qs);
void qtest_shutdown(QOSState *qs);
-void mkqcow2(const char *file, unsigned size_mb);
+bool mkqcow2(const char *file, unsigned size_mb);
void migrate(QOSState *from, QOSState *to, const char *uri);
void prepare_blkdebug_script(const char *debug_fn, const char *event);
void generate_pattern(void *buffer, size_t len, size_t cycle_len);
diff --git a/tests/qtest/virtio-scsi-test.c b/tests/qtest/virtio-scsi-test.c
index e2350c52f6..bce6c11813 100644
--- a/tests/qtest/virtio-scsi-test.c
+++ b/tests/qtest/virtio-scsi-test.c
@@ -292,7 +292,10 @@ static void test_iothread_attach_node(void *obj, void *data,
goto fail;
}
- mkqcow2(tmp_path, 64);
+ if (!mkqcow2(tmp_path, 64)) {
+ g_test_message("Could not create the qcow2 overlay");
+ goto fail;
+ }
/* Attach the overlay to the null0 node */
qtest_qmp_assert_success(scsi_pci->pci_vdev.pdev->bus->qts,
--
2.53.0
next prev parent reply other threads:[~2026-08-24 20:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-24 17:49 IDE failures under netbsd unit tests John Snow
2026-08-24 20:06 ` [PATCH 0/7] tests/qtest: fix the disk tests on a host with a small /tmp Denis V. Lunev
2026-08-27 10:16 ` Thomas Huth
2026-08-27 11:03 ` Daniel P. Berrangé
2026-09-01 13:41 ` Denis V. Lunev
2026-09-03 16:57 ` Fabiano Rosas
2026-09-03 17:04 ` Denis V. Lunev
2026-08-24 20:06 ` Denis V. Lunev [this message]
2026-08-24 20:06 ` [PATCH 2/7] tests/qtest/ide-test: skip when the scratch files cannot be created Denis V. Lunev
2026-08-24 20:06 ` [PATCH 3/7] tests/qtest/ahci-test: " Denis V. Lunev
2026-08-24 20:06 ` [PATCH 4/7] tests/qtest/hd-geo-test: skip when the scratch file " Denis V. Lunev
2026-08-24 20:06 ` [PATCH 5/7] tests/qtest/libqtest: create images with a byte-precise size Denis V. Lunev
2026-08-24 20:06 ` [PATCH 6/7] tests/qtest/ide-test: build the shared disks with qemu-img Denis V. Lunev
2026-08-24 20:06 ` [PATCH 7/7] tests/qtest/hd-geo-test: build the test images " Denis V. Lunev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260824200627.2180635-2-den@openvz.org \
--to=den@openvz.org \
--cc=jsnow@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.