Skip to content

Commit 26ce558

Browse files
committed
fix SystemVMs running in Xen HVM mode are not configured (#2760)
- Set hypervisor to xen-hvm when virt-what detects both HyperV cpuid and xen-domU
1 parent 13779dd commit 26ce558

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

systemvm/debian/opt/cloud/bin/setup/cloud-early-config

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ log_it() {
3535
}
3636

3737
hypervisor() {
38-
local try=$([ -x /usr/sbin/virt-what ] && virt-what | tail -1)
39-
[ "$try" != "" ] && echo $try && return 0
38+
[ -x /usr/sbin/virt-what ] && local facts=( $(virt-what) )
39+
if [ "$facts" != "" ]; then
40+
# Xen HVM is recognized as Hyperv when Viridian extensions are enabled
41+
if [ "${facts[-1]}" == "xen-domU" ] && [ "${facts[0]}" == "hyperv" ]; then
42+
echo "xen-hvm" && return 0
43+
else
44+
echo ${facts[-1]} && return 0
45+
fi
46+
fi
4047

4148
grep -q QEMU /proc/cpuinfo && echo "kvm" && return 0
4249
grep -q QEMU /var/log/messages && echo "kvm" && return 0
@@ -71,7 +78,7 @@ config_guest() {
7178

7279
get_boot_params() {
7380
case $HYPERVISOR in
74-
xen-pv|xen-domU)
81+
xen-pv)
7582
cat /proc/cmdline > $CMDLINE
7683
sed -i "s/%/ /g" $CMDLINE
7784
;;

0 commit comments

Comments
 (0)