-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add boot time optimizations for faster VM startup #68
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
f66dad5
f5fd27a
73a7252
2d95b49
f7e5933
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,13 +36,18 @@ func runExecMode(log *Logger, cfg *vmconfig.Config) { | |
| os.Setenv("PATH", "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin") | ||
| os.Setenv("HOME", "/root") | ||
|
|
||
| // Start guest-agent in background | ||
| log.Info("exec", "starting guest-agent in background") | ||
| agentCmd := exec.Command("/opt/hypeman/guest-agent") | ||
| agentCmd.Stdout = os.Stdout | ||
| agentCmd.Stderr = os.Stderr | ||
| if err := agentCmd.Start(); err != nil { | ||
| log.Error("exec", "failed to start guest-agent", err) | ||
| // Start guest-agent in background (skip if guest-agent was not copied) | ||
| var agentCmd *exec.Cmd | ||
| if cfg.SkipGuestAgent { | ||
| log.Info("exec", "skipping guest-agent (skip_guest_agent=true)") | ||
| } else { | ||
| log.Info("exec", "starting guest-agent in background") | ||
| agentCmd = exec.Command("/opt/hypeman/guest-agent") | ||
| agentCmd.Stdout = os.Stdout | ||
| agentCmd.Stderr = os.Stderr | ||
| if err := agentCmd.Start(); err != nil { | ||
| log.Error("exec", "failed to start guest-agent", err) | ||
| } | ||
| } | ||
|
|
||
| // Build the entrypoint command | ||
|
|
@@ -94,7 +99,7 @@ func runExecMode(log *Logger, cfg *vmconfig.Config) { | |
| // Wait for guest-agent (keeps init alive, prevents kernel panic) | ||
| // The guest-agent runs forever, so this effectively keeps the VM alive | ||
| // until it's explicitly terminated | ||
| if agentCmd.Process != nil { | ||
| if agentCmd != nil && agentCmd.Process != nil { | ||
|
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. VM terminates unexpectedly when skip_guest_agent is enabledMedium Severity When Additional Locations (1) |
||
| agentCmd.Wait() | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.