X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fganeti2%2Ffiles%2Fqemu-system-aarch64-wrapper;h=900d6aa64bfc23ba3d2d55bebdf14a12055e133b;hb=8c107072624a0b44645acad13d1f917580f7db2b;hp=1ad0d673903c3220457e3e891443beec489fe766;hpb=839e0ee97e5252968e9e0c5f7ae486fb0d26dd2e;p=mirror%2Fdsa-puppet.git diff --git a/modules/ganeti2/files/qemu-system-aarch64-wrapper b/modules/ganeti2/files/qemu-system-aarch64-wrapper index 1ad0d6739..900d6aa64 100755 --- a/modules/ganeti2/files/qemu-system-aarch64-wrapper +++ b/modules/ganeti2/files/qemu-system-aarch64-wrapper @@ -10,10 +10,8 @@ ## assumptions. ## -# With qemu-system-aarch64 the machine should be defined even for simple -# commands like querying the list of devices. -args=("-machine") -args+=("virt") +# Default to virt machine, forcing a gic version 3 to support more than 8 vcpus +machine="virt" # We want to always enable KVM. Contrary to what the Ganeti's documentation # says, enabling kvm_flag is not enough. @@ -22,11 +20,20 @@ args+=("-enable-kvm") while [ "$1" ]; do case "$1" in -machine|-M) - # Ignore the machine argument (it is already defined above), + # Ignore the machine argument (it will be defined below), # except when querying the list of machines if [ "$2" = "?" ] ; then - args+=("-M") - args+=("?") + machine="?" + fi + shift + ;; + -smp) + # Check if the CPU is configured to run in 32-bit mode and + # force the gvic to version 2 in that case + args+=("$1") + args+=("$2") + if test "$2" -gt 8 ; then + machine="virt,gic-version=3" fi shift ;; @@ -39,4 +46,10 @@ while [ "$1" ]; do shift done +# With qemu-system-aarch64 the machine should be defined even for simple +# commands like querying the list of devices. +args+=("-machine") +args+=($machine) + +# Start qemu-system-aarch64 with the mangled arguments exec /usr/bin/qemu-system-aarch64 "${args[@]}"