Skip to content

control: Allow reconfiguring the save/restore exec binary - #14469

Open
tanyifeng wants to merge 1 commit into
google:masterfrom
tanyifeng:reconfig-save-restore
Open

control: Allow reconfiguring the save/restore exec binary#14469
tanyifeng wants to merge 1 commit into
google:masterfrom
tanyifeng:reconfig-save-restore

Conversation

@tanyifeng

Copy link
Copy Markdown
Contributor

ConfigureSaveRestoreExec() rejected any call made when Kernel.SaveRestoreExecConfig was already set. The field is never cleared and is part of the saved kernel state, so checkpointing a sandbox a second time, or checkpointing a sandbox that was itself restored, always failed with "save/restore binary is already set".

Replace the stored configuration instead, and always resolve the leader task again, since a task stored by an earlier call may have exited, in which case SaveRestoreExec() silently skips the hook. Assign the configuration only after the lookup succeeds, so a failed lookup no longer leaves behind a config with a nil LeaderTask.

Add a test that checkpoints a sandbox twice and once more after a restore, asserting the hook runs every time.

ConfigureSaveRestoreExec() rejected any call made when
Kernel.SaveRestoreExecConfig was already set. The field is never
cleared and is part of the saved kernel state, so checkpointing a
sandbox a second time, or checkpointing a sandbox that was itself
restored, always failed with "save/restore binary is already set".

Replace the stored configuration instead, and always resolve the
leader task again, since a task stored by an earlier call may have
exited, in which case SaveRestoreExec() silently skips the hook.
Assign the configuration only after the lookup succeeds, so a failed
lookup no longer leaves behind a config with a nil LeaderTask.

Add a test that checkpoints a sandbox twice and once more after a
restore, asserting the hook runs every time.

Signed-off-by: Tan Yifeng <yiftan@tencent.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant