Reviewed-by: Cameron Esfahani <dirty@xxxxxxxxx> Cameron Esfahani dirty@xxxxxxxxx "The cake is a lie." Common wisdom > On Mar 20, 2020, at 7:55 AM, Roman Bolshakov <r.bolshakov@xxxxxxxxx> wrote: > > The tests can be run if Hypervisor.framework API is available: > > https://developer.apple.com/documentation/hypervisor?language=objc#1676667 > > Cc: Cameron Esfahani <dirty@xxxxxxxxx> > Signed-off-by: Roman Bolshakov <r.bolshakov@xxxxxxxxx> > --- > scripts/arch-run.bash | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash > index d3ca19d..197ae6c 100644 > --- a/scripts/arch-run.bash > +++ b/scripts/arch-run.bash > @@ -315,17 +315,30 @@ kvm_available () > ( [ "$HOST" = x86_64 ] && [ "$ARCH" = i386 ] ) > } > > +hvf_available () > +{ > + [ "$(sysctl -n kern.hv_support 2>/dev/null)" = "1" ] || return 1 > + [ "$HOST" = "$ARCH_NAME" ] || > + ( [ "$HOST" = x86_64 ] && [ "$ARCH" = i386 ] ) > +} > + > get_qemu_accelerator () > { > if [ "$ACCEL" = "kvm" ] && ! kvm_available; then > echo "KVM is needed, but not available on this host" >&2 > return 2 > fi > + if [ "$ACCEL" = "hvf" ] && ! hvf_available; then > + echo "HVF is needed, but not available on this host" >&2 > + return 2 > + fi > > if [ "$ACCEL" ]; then > echo $ACCEL > elif kvm_available; then > echo kvm > + elif hvf_available; then > + echo hvf > else > echo tcg > fi > -- > 2.24.1 >