aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2025-05-05 12:01:57 +0200
committerAleksandr Nogikh <nogikh@google.com>2025-05-05 13:26:26 +0000
commitae98e6b9615d9ca3a38a3bf107ec7f798368d8ff (patch)
tree8faa5ea2b312adbebd704a7415218ea8c9848325
parent6ca47dd8c9143c396aeae9f5bb3cafda25c78848 (diff)
vm/vmimpl: explicitly indicate empty boot output
It will help distinguish the cases when the output was collected, but lost somewhere during the reporting pipeline, or it was empty in the first place, e.g. because qemu could not start at all. Cc #5986.
-rw-r--r--vm/vmimpl/vmimpl.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/vm/vmimpl/vmimpl.go b/vm/vmimpl/vmimpl.go
index 8106d6166..6f2416494 100644
--- a/vm/vmimpl/vmimpl.go
+++ b/vm/vmimpl/vmimpl.go
@@ -96,6 +96,11 @@ type BootError struct {
}
func MakeBootError(err error, output []byte) error {
+ if len(output) == 0 {
+ // In reports, it may be helpful to distinguish the case when the boot output
+ // was collected, but turned out to be empty.
+ output = []byte("<empty boot output>")
+ }
var verboseError *osutil.VerboseError
if errors.As(err, &verboseError) {
return BootError{verboseError.Title, append(verboseError.Output, output...)}