File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -116,24 +116,27 @@ clean:
116116 $(VERBOSE ) find $(ROOT ) -name \* .img -delete
117117 $(VERBOSE ) find $(ROOT ) -name cscope.\* -delete
118118
119+ # Check whether we can use kvm for qemu
119120ifeq ($(SYSTEM ) ,LINUX)
121+ ifneq ($(USE_KVM ) , false) # you can hard-disable KVM use with the USE_KVM environment variable
122+ HAVE_KVM =$(shell lsmod | awk '/^kvm / {print $$1}')
123+ endif # USE_KVM
124+ endif # SYSTEM == LINUX
125+
126+ # Set qemu parameters
127+ ifeq ($(SYSTEM )$(HAVE_KVM ) ,LINUXkvm)
120128QEMU_PARAMS := -cpu host
121129else
122130QEMU_PARAMS := -cpu max
123131endif
132+ ifeq ($(HAVE_KVM ) , kvm)
133+ QEMU_PARAMS += -enable-kvm
134+ endif # HAVE_KVM
124135QEMU_PARAMS += -m 8192
125136QEMU_PARAMS += -display none -vga none -vnc none
126137QEMU_PARAMS += -serial stdio
127138QEMU_PARAMS += -no-reboot -no-shutdown
128139QEMU_PARAMS += -smp cpus=2
129- ifeq ($(SYSTEM ) ,LINUX)
130- ifneq ($(USE_KVM ) , false) # you can hard-disable KVM use with the USE_KVM environment variable
131- HAVE_KVM =$(shell lsmod | awk '/^kvm / {print $$1}')
132- ifeq ($(HAVE_KVM ) , kvm)
133- QEMU_PARAMS += -enable-kvm
134- endif # HAVE_KVM
135- endif # USE_KVM
136- endif # SYSTEM == LINUX
137140
138141QEMU_PARAMS_KERNEL := -append "param1 param2 param3"
139142QEMU_PARAMS_DEBUG := -s &
You can’t perform that action at this time.
0 commit comments