aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/mgrconfig
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2024-10-21 17:12:01 +0200
committerAlexander Potapenko <glider@google.com>2024-10-22 15:05:53 +0000
commit7d39db56757bb7e39dadbf6ac5f58d9b037205a8 (patch)
tree079bc714ecc3959710f641a74a735299f0470966 /pkg/mgrconfig
parent9d74f456bd5949d13672b9c64a330ebdd89b561a (diff)
pkg/mgrconfig: increase the timeouts if running on QEMU with TCG
Previously we were assuming that QEMU with matching host/guest architectures was using -enable-kvm, but for arm64 that's not always the case.
Diffstat (limited to 'pkg/mgrconfig')
-rw-r--r--pkg/mgrconfig/load.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/mgrconfig/load.go b/pkg/mgrconfig/load.go
index b5e171973..792802e60 100644
--- a/pkg/mgrconfig/load.go
+++ b/pkg/mgrconfig/load.go
@@ -4,6 +4,7 @@
package mgrconfig
import (
+ "bytes"
"fmt"
"os"
"path/filepath"
@@ -237,6 +238,11 @@ func (cfg *Config) completeServices() error {
func (cfg *Config) initTimeouts() {
slowdown := 1
switch {
+ case cfg.Type == "qemu" && (runtime.GOARCH == cfg.SysTarget.Arch || runtime.GOARCH == cfg.SysTarget.VMArch):
+ // If TCG is enabled for QEMU, increase the slowdown.
+ if bytes.Contains(cfg.VM, []byte("-accel tcg")) {
+ slowdown = 10
+ }
case cfg.Type == "qemu" && runtime.GOARCH != cfg.SysTarget.Arch && runtime.GOARCH != cfg.SysTarget.VMArch:
// Assuming qemu emulation.
// Quick tests of mmap syscall on arm64 show ~9x slowdown.