4 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
5 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
9 ## Wrapper to call qemu-system-aarch64 from Ganeti, removing all x86/PCI
13 # Default to virt machine, forcing a gic version 3 to support more than 8 vcpus
16 # We want to always enable KVM. Contrary to what the Ganeti's documentation
17 # says, enabling kvm_flag is not enough.
23 # Ignore the machine argument (it will be defined below),
24 # except when querying the list of machines
25 if [ "$2" = "?" ] ; then
31 # Check if the CPU is configured to run in 32-bit mode and
32 # force the gvic to version 2 in that case
35 if test "$2" -gt 8 ; then
36 machine="virt,gic-version=3"
41 # Replace PCI devices by their bus agnostic variant, and drop
42 # all the PCI related options
43 args+=("$(echo $1 | sed -e 's/virtio-\(\w\+\)-pci/virtio-\1-device/' -e 's/,bus=[^,]\+//' -e 's/,addr=[^,]\+//')")
49 # With qemu-system-aarch64 the machine should be defined even for simple
50 # commands like querying the list of devices.
54 # Start qemu-system-aarch64 with the mangled arguments
55 exec /usr/bin/qemu-system-aarch64 "${args[@]}"