aboutsummaryrefslogtreecommitdiffstats
path: root/syz-manager/snapshot.go
diff options
context:
space:
mode:
Diffstat (limited to 'syz-manager/snapshot.go')
-rw-r--r--syz-manager/snapshot.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/syz-manager/snapshot.go b/syz-manager/snapshot.go
index 21e6ed62b..f2a01961e 100644
--- a/syz-manager/snapshot.go
+++ b/syz-manager/snapshot.go
@@ -41,7 +41,9 @@ func (mgr *Manager) snapshotLoop(ctx context.Context, inst *vm.Instance) error {
// All network connections (including ssh) will break once we start restoring snapshots.
// So we start a background process and log to /dev/kmsg.
cmd := fmt.Sprintf("nohup %v exec snapshot 1>/dev/null 2>/dev/kmsg </dev/null &", executor)
- if _, _, err := inst.Run(time.Hour, mgr.reporter, cmd); err != nil {
+ ctxTimeout, cancel := context.WithTimeout(ctx, time.Hour)
+ defer cancel()
+ if _, _, err := inst.Run(ctxTimeout, mgr.reporter, cmd); err != nil {
return err
}