Skip to content

Commit

Permalink
Merge pull request #1241 from gibmat/fix-console-log-file-not-exist
Browse files Browse the repository at this point in the history
Don't return an error if console log file doesn't exist
  • Loading branch information
stgraber authored Sep 23, 2024
2 parents 58bdbb5 + f3b14f5 commit 6ac44ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/server/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -9381,6 +9381,11 @@ func (d *qemu) ConsoleLog() (string, error) {
// Read and return the complete log for this instance.
fullLog, err := os.ReadFile(d.common.ConsoleBufferLogPath())
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
// If there's no log file yet, such as right at VM creation, return an empty string.
return "", nil
}

return "", err
}

Expand Down

0 comments on commit 6ac44ae

Please sign in to comment.