aboutsummaryrefslogtreecommitdiff
path: root/qtest.c
diff options
context:
space:
mode:
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>2019-07-25 11:44:26 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2019-08-20 17:26:21 +0200
commitdcb1578069dd072f9aec74e3024cadb9ed0f3aae (patch)
treea3046cc620d45f20e983df481651c27402579767 /qtest.c
parent978ae0e99c1760c228eef2d320386daab3bf5b10 (diff)
util/qemu-timer: refactor deadline calculation for external timers
icount-based record/replay uses qemu_clock_deadline_ns_all to measure the period until vCPU may be interrupted. This function takes in account the virtual timers, because they belong to the virtual devices that may generate interrupt request or affect the virtual machine state. However, there are a subset of virtual timers, that are marked with 'external' flag. These do not change the virtual machine state and only based on virtual clock. Calculating the deadling using the external timers breaks the determinism, because they do not belong to the replayed part of the virtual machine. This patch fixes the deadline calculation for this case by adding new parameter for skipping the external timers when it is needed. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> -- v2 changes: - added new parameter for timer attribute mask Message-Id: <156404426682.18669.17014100602930969222.stgit@pasha-Precision-3630-Tower> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qtest.c')
-rw-r--r--qtest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/qtest.c b/qtest.c
index 59df1b6614..d8b4857c74 100644
--- a/qtest.c
+++ b/qtest.c
@@ -654,7 +654,8 @@ static void qtest_process_command(CharBackend *chr, gchar **words)
int ret = qemu_strtoi64(words[1], NULL, 0, &ns);
g_assert(ret == 0);
} else {
- ns = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
+ ns = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL,
+ QEMU_TIMER_ATTR_ALL);
}
qtest_clock_warp(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + ns);
qtest_send_prefix(chr);