Skip to content

Commit

Permalink
Merge pull request kubevirt#13412 from Barakmor1/log
Browse files Browse the repository at this point in the history
Improve virt-launcher logging
  • Loading branch information
kubevirt-bot authored Jan 30, 2025
2 parents 9e6af48 + b57ef9a commit 94307e7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cmd/virt-launcher-monitor/virt-launcher-monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func main() {
log.Log.Reason(err).Error("monitoring virt-launcher failed")
os.Exit(1)
}
log.Log.Info("virt-launcher-monitor: Exiting...")

os.Exit(exitCode)
}
Expand Down Expand Up @@ -194,14 +195,13 @@ func RunAndMonitor(containerDiskDir, uid string) (int, error) {
if err != nil {
log.Log.Reason(err).Errorf("Failed to reap process %d", wpid)
}

log.Log.Infof("Reaped pid %d with status %d", wpid, int(wstatus))
if wpid == cmd.Process.Pid {
log.Log.Infof("Reaped Launcher main pid")
exitStatus <- wstatus.ExitStatus()
}

log.Log.Infof("Reaped pid %d with status %d", wpid, int(wstatus))
default:
log.Log.V(3).Log("signalling virt-launcher to shut down")
log.Log.Infof("signalling virt-launcher to shut down")
err := cmd.Process.Signal(syscall.SIGTERM)
sig.Signal()
if err != nil {
Expand Down Expand Up @@ -230,6 +230,7 @@ func RunAndMonitor(containerDiskDir, uid string) (int, error) {
}

if pid > 0 {
log.Log.Infof("Killing QEMU gracefully.")
p, err := os.FindProcess(pid)
if err != nil {
return 1, err
Expand Down

0 comments on commit 94307e7

Please sign in to comment.