File tree Expand file tree Collapse file tree
systemvm/debian/opt/cloud/bin/setup Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,8 +35,15 @@ log_it() {
3535}
3636
3737hypervisor () {
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
7279get_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 ;;
You can’t perform that action at this time.
0 commit comments