From 4d77b9fe7da3d014943a16cb4b9a4ca3a531521a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 5 Jul 2024 17:20:13 +0200 Subject: all: add qemu snapshotting mode --- executor/common.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'executor/common.h') diff --git a/executor/common.h b/executor/common.h index a38768536..123723e5a 100644 --- a/executor/common.h +++ b/executor/common.h @@ -613,7 +613,8 @@ static void loop(void) #endif #if SYZ_EXECUTOR // Tell parent that we are ready to serve. - reply_execute(0); + if (!flag_snapshot) + reply_execute(0); #endif int iter = 0; #if SYZ_REPEAT_TIMES @@ -632,7 +633,8 @@ static void loop(void) reset_loop(); #endif #if SYZ_EXECUTOR - receive_execute(); + if (!flag_snapshot) + receive_execute(); #endif int pid = fork(); if (pid < 0) @@ -663,6 +665,11 @@ static void loop(void) } debug("spawned worker pid %d\n", pid); +#if SYZ_EXECUTOR + if (flag_snapshot) + SnapshotPrepareParent(); +#endif + // We used to use sigtimedwait(SIGCHLD) to wait for the subprocess. // But SIGCHLD is also delivered when a process stops/continues, // so it would require a loop with status analysis and timeout recalculation. -- cgit mrf-deployment