Skip to content

Commit eeeb471

Browse files
authored
Merge pull request #4204 from AkihiroSuda/fix-4152
qemu: fallback to TCG when KVM is not available
2 parents 81306c5 + 17c16df commit eeeb471

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/driver/qemu/qemu.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,8 +1124,13 @@ func Accel(arch limatype.Arch) string {
11241124
if limayaml.IsNativeArch(arch) {
11251125
switch runtime.GOOS {
11261126
case "darwin":
1127+
// TODO: return "tcg" if HVF is not available
11271128
return "hvf"
11281129
case "linux":
1130+
if _, err := os.Stat("/dev/kvm"); err != nil {
1131+
logrus.WithError(err).Warn("/dev/kvm is not available. Disabling KVM. Expect very poor performance.")
1132+
return "tcg"
1133+
}
11291134
return "kvm"
11301135
case "netbsd":
11311136
return "nvmm"

0 commit comments

Comments
 (0)