On 8/11/22 17:49, Alex Bennée wrote:
Although we call qemu_plugin_register_vcpu_idle_cb() in the bb test we
don't really exercise the rest of the state change callbacks. Add a
new test that tests the whole API.
[AJB: I wrote this in an attempt to flush out a reproducer for #1195
although so far now joy.]
Signed-off-by: Alex Bennée <alex.ben...@linaro.org>
Cc: Idan Horowitz <idan.horow...@gmail.com>
---
tests/plugin/vcpu.c | 140 +++++++++++++++++++++++++++++++++++++++
tests/plugin/meson.build | 2 +-
2 files changed, 141 insertions(+), 1 deletion(-)
create mode 100644 tests/plugin/vcpu.c
+static uint64_t get_timestamp(void) {
Checkpatch complains atbout this bracket ^ position ;)
+ struct timespec ts;
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return ts.tv_sec * 1000000000LL + ts.tv_nsec;
+}