diff options
author | Alexander Bulekov <alxndr@bu.edu> | 2023-02-04 23:29:43 -0500 |
---|---|---|
committer | Alexander Bulekov <alxndr@bu.edu> | 2023-02-16 22:08:37 -0500 |
commit | 8d1e76b35b420a6ecf3f69730a7588279031d617 (patch) | |
tree | ac9d028ed048a9f46f5b944fcb03497af10ad6a5 /tests/qtest/fuzz/fuzz.c | |
parent | 66169c3c60af5014c1940de7491fdf090e5a090a (diff) |
fuzz: add fuzz_reset API
As we are converting most fuzzers to rely on reboots to reset state,
introduce an API to make sure reboots are invoked in a consistent
manner.
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Diffstat (limited to 'tests/qtest/fuzz/fuzz.c')
-rw-r--r-- | tests/qtest/fuzz/fuzz.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index eb7520544b..3bedb81b32 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -51,6 +51,12 @@ void flush_events(QTestState *s) } } +void fuzz_reset(QTestState *s) +{ + qemu_system_reset(SHUTDOWN_CAUSE_GUEST_RESET); + main_loop_wait(true); +} + static QTestState *qtest_setup(void) { qtest_server_set_send_handler(&qtest_client_inproc_recv, &fuzz_qts); |