Include QEMU output in error when Start fails
This commit is contained in:
parent
13ce8a782d
commit
221d0ca596
1 changed files with 5 additions and 3 deletions
|
|
@ -111,12 +111,14 @@ func Start(cfg *config.Config, reg *workspace.Registry) mo.Result[struct{}] {
|
|||
logging.Info(fmt.Sprintf("Starting QEMU with %d mounts...", len(mounts)))
|
||||
|
||||
cmd := exec.Command("qemu-system-x86_64", args...)
|
||||
cmd.Stdout = nil
|
||||
cmd.Stderr = nil
|
||||
cmd.Stdin = nil
|
||||
|
||||
if err := cmd.Run(); err != nil {
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
vfsManager.StopAll()
|
||||
if len(output) > 0 {
|
||||
return mo.Err[struct{}](fmt.Errorf("failed to start QEMU: %w\n\nQEMU output:\n%s", err, string(output)))
|
||||
}
|
||||
return mo.Err[struct{}](fmt.Errorf("failed to start QEMU: %w\n\nTry running 'qvm doctor' to diagnose the issue.", err))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue