dev: add support for automatic hypervisor.framework usage on macOS

This commit is contained in:
2025-10-21 05:40:22 -07:00
parent 22c8884f7e
commit 2aeb0474e6
2 changed files with 6 additions and 1 deletions

View File

@@ -41,3 +41,8 @@ if [ -z "${QEMU_ACCEL}" ] && [ "${TARGET_ARCH}" = "${HOST_ARCH}" ] &&
grep -E '^flags.*:.+ vmx .*' /proc/cpuinfo >/dev/null; then grep -E '^flags.*:.+ vmx .*' /proc/cpuinfo >/dev/null; then
QEMU_ACCEL="kvm" QEMU_ACCEL="kvm"
fi fi
if [ "$(uname)" = "Darwin" ] && [ "${TARGET_ARCH}" = "${HOST_ARCH}" ] &&
[ "$(sysctl -n kern.hv_support 2>&1 || true)" = "1" ]; then
QEMU_ACCEL="hvf"
fi

View File

@@ -19,7 +19,7 @@ elif [ "${TARGET_ARCH}" = "aarch64" ]; then
fi fi
if [ -n "${QEMU_ACCEL}" ]; then if [ -n "${QEMU_ACCEL}" ]; then
set -- "${@}" "-accel" "kvm" set -- "${@}" "-accel" "${QEMU_ACCEL}"
fi fi
if [ "${QEMU_GDB}" = "1" ]; then if [ "${QEMU_GDB}" = "1" ]; then