From ae98e6b9615d9ca3a38a3bf107ec7f798368d8ff Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 5 May 2025 12:01:57 +0200 Subject: 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. --- vm/vmimpl/vmimpl.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vm') 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("") + } var verboseError *osutil.VerboseError if errors.As(err, &verboseError) { return BootError{verboseError.Title, append(verboseError.Output, output...)} -- cgit mrf-deployment