rhtyd closed pull request #2824: Fix SystemVMs running in Xen HVM mode are not 
configured (#2760)
URL: https://github.com/apache/cloudstack/pull/2824
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config 
b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
index 9baed018b7f..99acb86e5dd 100755
--- a/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
+++ b/systemvm/debian/opt/cloud/bin/setup/cloud-early-config
@@ -35,14 +35,8 @@ log_it() {
 }
 
 hypervisor() {
-  local try=$([ -x /usr/sbin/virt-what ] && virt-what | tail -1)
-  [ "$try" != "" ] && echo $try && return 0
-
-  grep -q QEMU /proc/cpuinfo  && echo "kvm" && return 0
-  grep -q QEMU /var/log/messages && echo "kvm" && return 0
-
-  [ -d /proc/xen ] && mount -t xenfs none /proc/xen
   if [ -d /proc/xen ]; then
+    mount -t xenfs none /proc/xen
     $(dmesg | grep -q "Xen HVM")
     if [ $? -eq 0 ]; then  # 1=PV,0=HVM
       echo "xen-hvm" && return 0
@@ -51,6 +45,19 @@ hypervisor() {
     fi
   fi
 
+  [ -x /usr/sbin/virt-what ] && local facts=( $(virt-what) )
+  if [ "$facts" != "" ]; then
+    # Xen HVM is recognized as Hyperv when Viridian extensions are enabled
+    if [ "${facts[-1]}" == "xen-domU" ] && [ "${facts[0]}" == "hyperv" ]; then
+      echo "xen-hvm" && return 0
+    else
+      echo ${facts[-1]} && return 0
+    fi
+  fi
+
+  grep -q QEMU /proc/cpuinfo  && echo "kvm" && return 0
+  grep -q QEMU /var/log/messages && echo "kvm" && return 0
+
   vmware-checkvm &> /dev/null && echo "vmware" && return 0
 
   echo "unknown" && return 1


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to