-
Notifications
You must be signed in to change notification settings - Fork 13
feat(cloudhypervisor): make watchdog policy configurable #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ad22695
46cb496
a77091c
42f21ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -328,6 +328,9 @@ func (h Handler) prepareClone(ctx context.Context, cmd *cobra.Command, conf *con | |
| if err = vmCfg.Validate(); err != nil { | ||
| return cloneSetup{}, err | ||
| } | ||
| if err = validateBackendFlags(conf, vmCfg); err != nil { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with the clone flag gone this call is unreachable by construction: every knob the switch gates is inherited from the snapshot on clone, and an fc snapshot can't carry any of them because create already rejects them. the test that covered it got removed too, so this is now an untested guard for a state that can't happen. please drop these three lines and put the godoc back to 'create and debug'. |
||
| return cloneSetup{}, err | ||
| } | ||
| // Envelope pins share create's digest-lock window; a record-backed clone's source pin already protects these. | ||
| releasePins, err := cmdcore.PinEnvelopeBlobs(ctx, conf, cfg.ImageBlobIDs) | ||
| if err != nil { | ||
|
|
@@ -476,7 +479,7 @@ func (h Handler) createVM(cmd *cobra.Command, image string) (context.Context, *t | |
| return ctx, info, hyper, nil | ||
| } | ||
|
|
||
| // validateBackendFlags fast-fails flag combinations the selected backend can never launch; boot-mode-dependent checks live in validateBootCompat. Shared by create and debug so the capability gate list cannot drift. | ||
| // validateBackendFlags fast-fails flag combinations the selected backend can never launch; boot-mode-dependent checks live in validateBootCompat. Shared by create, clone, and debug so the capability gate list cannot drift. | ||
| func validateBackendFlags(conf *config.Config, vmCfg *types.VMConfig) error { | ||
| if !conf.UseFirecracker { | ||
| return nil | ||
|
|
@@ -490,6 +493,8 @@ func validateBackendFlags(conf *config.Config, vmCfg *types.VMConfig) error { | |
| return fmt.Errorf("--fc and --hugepages are mutually exclusive: Firecracker cannot restore hugetlbfs-backed snapshots") | ||
| case vmCfg.Mergeable: | ||
| return fmt.Errorf("--fc and --mergeable are mutually exclusive: Firecracker has no KSM madvise knob") | ||
| case vmCfg.NoWatchdog: | ||
| return fmt.Errorf("--fc and --no-watchdog are mutually exclusive: Firecracker does not expose a virtio watchdog") | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this local only existed for the override branch. with that gone it's a plain pass through, inline it like the siblings: NoWatchdog: snapCfg.NoWatchdog in the literal below and drop this line.