Merge pull request #9601 from cncal/fix_redundant_log

qemu: the error is logged only when it occurs
This commit is contained in:
Alex Lyn 2024-05-08 08:59:01 +08:00 committed by GitHub
commit 875e6e3815
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -156,6 +156,8 @@ func (q *qemuArm64) enableProtection() error {
func (q *qemuArm64) appendProtectionDevice(devices []govmmQemu.Device, firmware, firmwareVolume string) ([]govmmQemu.Device, string, error) {
err := q.enableProtection()
hvLogger.WithField("arch", runtime.GOARCH).Warnf("%v", err)
if err != nil {
hvLogger.WithField("arch", runtime.GOARCH).Error(err)
}
return devices, firmware, err
}