fix: qemu timeout priorities
This commit is contained in:
parent
b626012591
commit
5fcc874985
10
cmd/pew.go
10
cmd/pew.go
@ -230,9 +230,13 @@ func (cmd *PewCmd) Run(g *Globals) (err error) {
|
|||||||
ka.Targets = []artifact.Target{km}
|
ka.Targets = []artifact.Target{km}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO there was a lib for merge structures
|
if ka.Qemu.Timeout.Duration == 0 {
|
||||||
ka.Qemu.Timeout.Duration = g.Config.Qemu.Timeout.Duration
|
ka.Qemu.Timeout.Duration = g.Config.Qemu.Timeout.Duration
|
||||||
ka.Docker.Timeout.Duration = g.Config.Docker.Timeout.Duration
|
}
|
||||||
|
|
||||||
|
if ka.Docker.Timeout.Duration == 0 {
|
||||||
|
ka.Docker.Timeout.Duration = g.Config.Docker.Timeout.Duration
|
||||||
|
}
|
||||||
|
|
||||||
if cmd.QemuTimeout != 0 {
|
if cmd.QemuTimeout != 0 {
|
||||||
log.Info().Msgf("Set qemu timeout to %s", cmd.QemuTimeout)
|
log.Info().Msgf("Set qemu timeout to %s", cmd.QemuTimeout)
|
||||||
|
@ -342,6 +342,7 @@ func (q *System) Start() (err error) {
|
|||||||
|
|
||||||
if q.Timeout != 0 {
|
if q.Timeout != 0 {
|
||||||
go func() {
|
go func() {
|
||||||
|
q.Log.Debug().Msgf("qemu wait for %s before kill", q.Timeout)
|
||||||
time.Sleep(q.Timeout)
|
time.Sleep(q.Timeout)
|
||||||
q.KilledByTimeout = true
|
q.KilledByTimeout = true
|
||||||
q.Stop()
|
q.Stop()
|
||||||
|
Loading…
Reference in New Issue
Block a user