Skip to content

Commit 470bf3f

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 470bf3f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 9 additions & 2 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

0 commit comments

Comments
 (0)