cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [1/2] git commit: updated refs/heads/4.5 to 8b83417
Date Tue, 21 Oct 2014 17:31:57 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 287ff8355 -> 8b834171b


Revert "fix kvm issue, for windows sever 2008, it will crash without hyperv enlightment featre
enabled"

This reverts commit c9dcae548056aa477e4156a1ec2efc9a83813aed.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6d22ff1d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6d22ff1d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6d22ff1d

Branch: refs/heads/4.5
Commit: 6d22ff1d946b2368527203ee7c07ae180147a17c
Parents: 287ff83
Author: Edison Su <sudison@gmail.com>
Authored: Tue Oct 21 10:16:59 2014 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Tue Oct 21 10:16:59 2014 -0700

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java  | 26 ---------------
 .../hypervisor/kvm/resource/LibvirtVMDef.java   | 35 --------------------
 .../kvm/resource/LibvirtVMDefTest.java          | 22 ------------
 3 files changed, 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d22ff1d/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 55b49c2..9a4ae16 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -454,7 +454,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
     protected boolean _noKvmClock;
     protected String _videoHw;
     protected int _videoRam;
-    protected Pair<Integer,Integer> hostOsVersion;
     private final Map <String, String> _pifs = new HashMap<String, String>();
     private final Map<String, VmStats> _vmStats = new ConcurrentHashMap<String,
VmStats>();
 
@@ -966,7 +965,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         String[] kernelVersions = unameKernelVersion.split("[\\.\\-]");
         _kernelVersion = Integer.parseInt(kernelVersions[0]) * 1000 * 1000 + Integer.parseInt(kernelVersions[1])
* 1000 + Integer.parseInt(kernelVersions[2]);
 
-        getOsVersion();
         return true;
     }
 
@@ -3608,24 +3606,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         return uuid;
     }
 
-    private void getOsVersion() {
-        String version = Script.runSimpleBashScript("cat /etc/redhat-release | awk '{print
$7}'");
-        if (version != null) {
-            String[] versions = version.split(".");
-            if (versions.length == 2) {
-                String major = versions[0];
-                String minor = versions[1];
-                try {
-                    Integer m = Integer.parseInt(major);
-                    Integer min = Integer.parseInt(minor);
-                    hostOsVersion = new Pair<>(m, min);
-                } catch(NumberFormatException e) {
-
-                }
-            }
-        }
-    }
-
     protected LibvirtVMDef createVMFromSpec(VirtualMachineTO vmTO) {
         LibvirtVMDef vm = new LibvirtVMDef();
         vm.setDomainName(vmTO.getName());
@@ -3704,12 +3684,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         features.addFeatures("pae");
         features.addFeatures("apic");
         features.addFeatures("acpi");
-        //for rhel 6.5 and above, hyperv enlightment feature is added
-        if (vmTO.getOs().contains("Windows Server 2008") && hostOsVersion != null
&& ((hostOsVersion.first() == 6 && hostOsVersion.second() >= 5) || (hostOsVersion.first()
>= 7))) {
-            LibvirtVMDef.HyperVEnlightenmentFeatureDef hyv = new LibvirtVMDef.HyperVEnlightenmentFeatureDef();
-            hyv.setRelaxed(true);
-            features.addHyperVFeature(hyv);
-        }
         vm.addComp(features);
 
         TermPolicy term = new TermPolicy();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d22ff1d/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
index 2ce2442..bc95204 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
@@ -173,42 +173,13 @@ public class LibvirtVMDef {
         }
     }
 
-    public static class HyperVEnlightenmentFeatureDef {
-        private final Map<String, String> features = new HashMap<String,String>();
-        public void setRelaxed(boolean on) {
-            String state = on ? "On":"Off";
-            features.put("relaxed", state);
-        }
-        @Override
-        public String toString() {
-            if (features.isEmpty()) {
-                return "";
-            }
-            StringBuilder feaBuilder = new StringBuilder();
-            feaBuilder.append("<hyperv>\n");
-            for (Map.Entry<String, String> e : features.entrySet()) {
-                feaBuilder.append("<");
-                feaBuilder.append(e.getKey());
-                feaBuilder.append(" state='" + e.getValue() + "'");
-                feaBuilder.append("/>\n");
-            }
-            feaBuilder.append("</hyperv>\n");
-            return feaBuilder.toString();
-        }
-    }
-
     public static class FeaturesDef {
         private final List<String> _features = new ArrayList<String>();
 
-        private HyperVEnlightenmentFeatureDef hyperVEnlightenmentFeatureDef = null;
         public void addFeatures(String feature) {
             _features.add(feature);
         }
 
-        public void addHyperVFeature(HyperVEnlightenmentFeatureDef hyperVEnlightenmentFeatureDef)
{
-            this.hyperVEnlightenmentFeatureDef = hyperVEnlightenmentFeatureDef;
-        }
-
         @Override
         public String toString() {
             StringBuilder feaBuilder = new StringBuilder();
@@ -216,12 +187,6 @@ public class LibvirtVMDef {
             for (String feature : _features) {
                 feaBuilder.append("<" + feature + "/>\n");
             }
-            if (hyperVEnlightenmentFeatureDef != null) {
-                String hpervF = hyperVEnlightenmentFeatureDef.toString();
-                if (hpervF != "") {
-                    feaBuilder.append(hpervF);
-                }
-            }
             feaBuilder.append("</features>\n");
             return feaBuilder.toString();
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6d22ff1d/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
index ddbe256..aa7570c 100644
--- a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
+++ b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtVMDefTest.java
@@ -21,7 +21,6 @@ package com.cloud.hypervisor.kvm.resource;
 
 import junit.framework.TestCase;
 import com.cloud.hypervisor.kvm.resource.LibvirtVMDef.DiskDef;
-import com.cloud.utils.Pair;
 
 public class LibvirtVMDefTest extends TestCase {
 
@@ -91,25 +90,4 @@ public class LibvirtVMDefTest extends TestCase {
         assertEquals(xmlDef, expectedXml);
     }
 
-    public void testHypervEnlightDef() {
-        LibvirtVMDef.FeaturesDef featuresDef = new LibvirtVMDef.FeaturesDef();
-        LibvirtVMDef.HyperVEnlightenmentFeatureDef hyperVEnlightenmentFeatureDef = new LibvirtVMDef.HyperVEnlightenmentFeatureDef();
-        hyperVEnlightenmentFeatureDef.setRelaxed(true);
-        featuresDef.addHyperVFeature(hyperVEnlightenmentFeatureDef);
-        String defs = featuresDef.toString();
-        assertTrue(defs.contains("relaxed"));
-
-        featuresDef = new LibvirtVMDef.FeaturesDef();
-        featuresDef.addFeatures("pae");
-        defs = featuresDef.toString();
-        assertFalse(defs.contains("relaxed"));
-
-        assertTrue("Windows Server 2008 R2".contains("Windows Server 2008"));
-
-        Pair<Integer,Integer> hostOsVersion = new Pair<Integer,Integer>(6,5);
-        assertTrue((hostOsVersion.first() == 6 && hostOsVersion.second() >= 5)
|| (hostOsVersion.first() >= 7));
-        hostOsVersion = new Pair<Integer,Integer>(7,1);
-        assertTrue((hostOsVersion.first() == 6 && hostOsVersion.second() >= 5)
|| (hostOsVersion.first() >= 7));
-    }
-
 }


Mime
View raw message