mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-16 08:26:16 +00:00
Merge pull request #2055 from lifupan/fix_missingqemulog
virtcontainers: fix the issue of missing qemu error logs
This commit is contained in:
commit
948dd3303a
@ -763,7 +763,15 @@ func (q *qemu) startSandbox(timeout int) error {
|
||||
var strErr string
|
||||
strErr, err = govmmQemu.LaunchQemu(q.qemuConfig, newQMPLogger())
|
||||
if err != nil {
|
||||
return fmt.Errorf("fail to launch qemu: %s, error messages from qemu log: %s", err, strErr)
|
||||
if q.config.Debug && q.qemuConfig.LogFile != "" {
|
||||
b, err := ioutil.ReadFile(q.qemuConfig.LogFile)
|
||||
if err == nil {
|
||||
strErr += string(b)
|
||||
}
|
||||
}
|
||||
|
||||
q.Logger().WithError(err).Errorf("failed to launch qemu: %s", strErr)
|
||||
return fmt.Errorf("failed to launch qemu: %s, error messages from qemu log: %s", err, strErr)
|
||||
}
|
||||
|
||||
err = q.waitSandbox(timeout) // the virtiofsd deferred checks err's value
|
||||
|
Loading…
Reference in New Issue
Block a user