diff --git a/internal/server/instance/drivers/driver_qemu.go b/internal/server/instance/drivers/driver_qemu.go index dfa1173c281..3b8875f2e16 100644 --- a/internal/server/instance/drivers/driver_qemu.go +++ b/internal/server/instance/drivers/driver_qemu.go @@ -7761,9 +7761,14 @@ func (d *qemu) renderState(statusCode api.StatusCode) (*api.InstanceState, error } } } + + status.Pid = int64(pid) + status.StartedAt, err = d.processStartedAt(d.InitPID()) + if err != nil { + return status, err + } } - status.Pid = int64(pid) status.Status = statusCode.String() status.StatusCode = statusCode status.Disk, err = d.diskState() @@ -7771,11 +7776,6 @@ func (d *qemu) renderState(statusCode api.StatusCode) (*api.InstanceState, error d.logger.Warn("Error getting disk usage", logger.Ctx{"err": err}) } - status.StartedAt, err = d.processStartedAt(d.InitPID()) - if err != nil { - return status, err - } - return status, nil }