[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 02/10] fuzz: add fuzz_reboot API
From: |
Alexander Bulekov |
Subject: |
[PATCH 02/10] fuzz: add fuzz_reboot API |
Date: |
Sat, 4 Feb 2023 23:29:43 -0500 |
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>
---
tests/qtest/fuzz/fuzz.c | 6 ++++++
tests/qtest/fuzz/fuzz.h | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c
index eb7520544b..c2d07a4c7e 100644
--- a/tests/qtest/fuzz/fuzz.c
+++ b/tests/qtest/fuzz/fuzz.c
@@ -51,6 +51,12 @@ void flush_events(QTestState *s)
}
}
+void fuzz_reboot(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);
diff --git a/tests/qtest/fuzz/fuzz.h b/tests/qtest/fuzz/fuzz.h
index 327c1c5a55..69e2b3877f 100644
--- a/tests/qtest/fuzz/fuzz.h
+++ b/tests/qtest/fuzz/fuzz.h
@@ -103,7 +103,7 @@ typedef struct FuzzTarget {
} FuzzTarget;
void flush_events(QTestState *);
-void reboot(QTestState *);
+void fuzz_reboot(QTestState *);
/* Use the QTest ASCII protocol or call address_space API directly?*/
void fuzz_qtest_set_serialize(bool option);
--
2.39.0
- Re: [PATCH 01/10] hw/sparse-mem: clear memory on reset, (continued)
- [PATCH 03/10] fuzz/generic-fuzz: use reboots instead of forks to reset state, Alexander Bulekov, 2023/02/04
- [PATCH 04/10] fuzz/generic-fuzz: add a limit on DMA bytes written, Alexander Bulekov, 2023/02/04
- [PATCH 05/10] fuzz/virtio-scsi: remove fork-based fuzzer, Alexander Bulekov, 2023/02/04
- [PATCH 02/10] fuzz: add fuzz_reboot API,
Alexander Bulekov <=
- [PATCH 06/10] fuzz/virtio-net: remove fork-based fuzzer, Alexander Bulekov, 2023/02/04
- [PATCH 07/10] fuzz/virtio-blk: remove fork-based fuzzer, Alexander Bulekov, 2023/02/04
- [PATCH 08/10] fuzz/i440fx: remove fork-based fuzzer, Alexander Bulekov, 2023/02/04
- [PATCH 10/10] docs/fuzz: remove mentions of fork-based fuzzing, Alexander Bulekov, 2023/02/04