Skip to content

Commit

Permalink
Merge pull request #13 from stackhpc/fix/arch-emulator
Browse files Browse the repository at this point in the history
Default to software emulation if target architecture != host_architecture
  • Loading branch information
jovial authored Nov 1, 2018
2 parents 435ea81 + 6140738 commit 750252d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tasks/autodetect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@

- name: Set a fact containing the virtualisation engine
set_fact:
libvirt_vm_engine: "{% if stat_kvm.stat.exists %}kvm{% else %}qemu{% endif %}"
libvirt_vm_engine: >-
{%- if ansible_architecture != libvirt_vm_arch -%}
{# Virtualisation instructions are generally available only for the host
architecture. Ideally we would test for virtualisation instructions, eg. vt-d
as it is possible that another architecture could support these even
if the emulated cpu architecture is not the same. #}
qemu
{%- elif stat_kvm.stat.exists -%}
kvm
{%- else -%}
qemu
{%- endif -%}
when: libvirt_vm_engine is none

- name: Detect the virtualisation emulator
Expand Down

0 comments on commit 750252d

Please sign in to comment.