1
0

fix: qemu timeout priorities

This commit is contained in:
dump_stack() 2024-10-05 20:28:48 +00:00
parent b626012591
commit 5fcc874985
Signed by: dump_stack
GPG Key ID: C9905BA72B5E02BB
2 changed files with 8 additions and 3 deletions

View File

@ -230,9 +230,13 @@ func (cmd *PewCmd) Run(g *Globals) (err error) {
ka.Targets = []artifact.Target{km}
}
// TODO there was a lib for merge structures
ka.Qemu.Timeout.Duration = g.Config.Qemu.Timeout.Duration
ka.Docker.Timeout.Duration = g.Config.Docker.Timeout.Duration
if ka.Qemu.Timeout.Duration == 0 {
ka.Qemu.Timeout.Duration = g.Config.Qemu.Timeout.Duration
}
if ka.Docker.Timeout.Duration == 0 {
ka.Docker.Timeout.Duration = g.Config.Docker.Timeout.Duration
}
if cmd.QemuTimeout != 0 {
log.Info().Msgf("Set qemu timeout to %s", cmd.QemuTimeout)

View File

@ -342,6 +342,7 @@ func (q *System) Start() (err error) {
if q.Timeout != 0 {
go func() {
q.Log.Debug().Msgf("qemu wait for %s before kill", q.Timeout)
time.Sleep(q.Timeout)
q.KilledByTimeout = true
q.Stop()