[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 6/7] tests/qtest: tighten up the checks on clock_step
From: |
Alex Bennée |
Subject: |
[PATCH 6/7] tests/qtest: tighten up the checks on clock_step |
Date: |
Mon, 20 Jan 2025 21:02:11 +0000 |
It is invalid to call clock_step with an implied time to step forward
as if no timers are running we won't be able to advance.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
system/qtest.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/system/qtest.c b/system/qtest.c
index 28b6fac37c..1a9bfd0b33 100644
--- a/system/qtest.c
+++ b/system/qtest.c
@@ -708,10 +708,15 @@ static void qtest_process_command(CharBackend *chr, gchar
**words)
} else {
ns = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
QEMU_TIMER_ATTR_ALL);
+ if (ns < 0) {
+ qtest_send(chr, "FAIL "
+ "no timers for clock_step to follow\n");
+ return;
+ }
}
new_ns = qemu_clock_advance_virtual_time(old_ns + ns);
qtest_sendf(chr, "%s %"PRIi64"\n",
- new_ns > old_ns ? "OK" : "FAIL", new_ns);
+ new_ns > old_ns ? "OK" : "FAIL could not advance time",
new_ns);
} else if (strcmp(words[0], "module_load") == 0) {
Error *local_err = NULL;
int rv;
--
2.39.5
- [PATCH 0/7] testing/next (qtest timer stuff), Alex Bennée, 2025/01/20
- [PATCH 7/7] Revert "util/timer: avoid deadlock when shutting down", Alex Bennée, 2025/01/20
- [PATCH 2/7] tests/qtest: don't attempt to clock_step while waiting for virtio ISR, Alex Bennée, 2025/01/20
- [PATCH 5/7] tests/qtest: rename qtest_send_prefix and roll-up into qtest_send, Alex Bennée, 2025/01/20
- [PATCH 1/7] tests/docker: replicate the check-rust-tools-nightly CI job, Alex Bennée, 2025/01/20
- [PATCH 3/7] tests/qtest: don't step clock at start of npcm7xx periodic IRQ test, Alex Bennée, 2025/01/20
- [PATCH 4/7] tests/qtest: simplify qtest_process_inbuf, Alex Bennée, 2025/01/20
- [PATCH 6/7] tests/qtest: tighten up the checks on clock_step,
Alex Bennée <=
- Re: [PATCH 0/7] testing/next (qtest timer stuff), Thomas Huth, 2025/01/21
- Re: [PATCH 0/7] testing/next (qtest timer stuff), Fabiano Rosas, 2025/01/21