@@ -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;
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(-)