runtime: explicitly mark the source of the log is from qemu.log

In qemu.StopVM(), if debug is enabled, the shim will dump logs
from qemu.log, but users don't know which logs are from qemu.log
and shim itself. Adding some additional messages will
help users to distinguish these logs.

Fixes: #4745

Signed-off-by: Bin Liu <bin@hyper.sh>
This commit is contained in:
Bin Liu 2022-07-26 16:08:59 +08:00
parent a238d8c6bd
commit 85f4e7caf6

View File

@ -990,7 +990,7 @@ func (q *qemu) StopVM(ctx context.Context, waitOnly bool) error {
if err == nil { if err == nil {
scanner := bufio.NewScanner(f) scanner := bufio.NewScanner(f)
for scanner.Scan() { for scanner.Scan() {
q.Logger().Debug(scanner.Text()) q.Logger().WithField("file", q.qemuConfig.LogFile).Debug(scanner.Text())
} }
if err := scanner.Err(); err != nil { if err := scanner.Err(); err != nil {
q.Logger().WithError(err).Debug("read qemu log failed") q.Logger().WithError(err).Debug("read qemu log failed")