浏览代码

build, Makefile: check for kvm presence before using it

If the kvm module is not present, we won't see /dev/kvm. Check kvm
availability with that.

Signed-off-by: greatbridf <greatbridf@icloud.com>
greatbridf 6 月之前
父节点
当前提交
c0fcd375bd
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Makefile.src

+ 4 - 0
Makefile.src

@@ -27,9 +27,13 @@ CARGO_FLAGS := --profile $(PROFILE) --features $(FEATURES)$(if $(SMP),$(COMMA)sm
 ifeq ($(HOST),darwin)
 QEMU_ACCEL ?= -accel tcg
 else ifeq ($(HOST),linux)
+
+ifeq ($(shell ls /dev/kvm),/dev/kvm)
 QEMU_ACCEL ?= -accel kvm
 endif
 
+endif
+
 QEMU_ARGS += $(QEMU_ACCEL)
 
 ifneq ($(DEBUG_TRAPS),)