aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-07-05 17:20:13 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-07-25 13:12:57 +0000
commit4d77b9fe7da3d014943a16cb4b9a4ca3a531521a (patch)
treec37fbf8b50205eb8b830595a621ad4b355e32e9a /executor/common.h
parent206f31df2861c47b13a8c05a105afa94bcc7106c (diff)
all: add qemu snapshotting mode
Diffstat (limited to 'executor/common.h')
-rw-r--r--executor/common.h11
1 files changed, 9 insertions, 2 deletions
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.