projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
qemu-system-aarch64-wrapper: do not force the gvic to version 3 for 32-bit vCPUs
[mirror/dsa-puppet.git]
/
modules
/
ganeti2
/
files
/
qemu-system-aarch64-wrapper
diff --git
a/modules/ganeti2/files/qemu-system-aarch64-wrapper
b/modules/ganeti2/files/qemu-system-aarch64-wrapper
index
5411e51
..
d00d155
100755
(executable)
--- a/
modules/ganeti2/files/qemu-system-aarch64-wrapper
+++ b/
modules/ganeti2/files/qemu-system-aarch64-wrapper
@@
-10,10
+10,8
@@
## assumptions.
##
## assumptions.
##
-# With qemu-system-aarch64 the machine should be defined even for simple
-# commands like querying the list of devices.
-args=("-machine")
-args+=("virt,gic-version=3")
+# Default to virt machine, forcing a gic version 3 to support more than 8 vcpus
+machine="virt,gic-version=3"
# We want to always enable KVM. Contrary to what the Ganeti's documentation
# says, enabling kvm_flag is not enough.
# We want to always enable KVM. Contrary to what the Ganeti's documentation
# says, enabling kvm_flag is not enough.
@@
-22,7
+20,7
@@
args+=("-enable-kvm")
while [ "$1" ]; do
case "$1" in
-machine|-M)
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")
# except when querying the list of machines
if [ "$2" = "?" ] ; then
args+=("-M")
@@
-30,6
+28,16
@@
while [ "$1" ]; do
fi
shift
;;
fi
shift
;;
+ -cpu)
+ # 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 echo "$2" | egrep -q '(^|,)aarch64=off(,|$)' ; then
+ machine="virt,gic-version=2"
+ fi
+ shift
+ ;;
*)
# Replace PCI devices by their bus agnostic variant, and drop
# all the PCI related options
*)
# Replace PCI devices by their bus agnostic variant, and drop
# all the PCI related options
@@
-39,4
+47,10
@@
while [ "$1" ]; do
shift
done
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[@]}"
exec /usr/bin/qemu-system-aarch64 "${args[@]}"