Hello Vitor de Lima,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/20614
to review the following change.
Change subject: core: Add POWER 7 to the CPU list
......................................................................
core: Add POWER 7 to the CPU list
* This introduces the POWER 7 to the list of supported CPUs.
* The ClusterEmulatedMachines configuration value was changed to
include the "pseries" emulated machine.
Change-Id: Id56ef93cd377bdadc10db008618ab4bbb8ed7170
Signed-off-by: Vitor de Lima <[email protected]>
Signed-off-by: Gustavo Pedrosa <[email protected]>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java
M
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java
M
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/ServerCpuParserTest.java
M packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
4 files changed, 35 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/14/20614/1
diff --git
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java
index b226517..9d67f0a 100644
---
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java
+++
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CpuFlagsManagerHandler.java
@@ -108,13 +108,17 @@
private static class CpuFlagsManager {
private List<ServerCpu> _intelCpuList;
private List<ServerCpu> _amdCpuList;
+ private List<ServerCpu> _ibmCpuList;
private List<ServerCpu> _allCpuList = new ArrayList<ServerCpu>();
private Map<String, ServerCpu> _intelCpuByNameDictionary =
new HashMap<String, ServerCpu>();
private Map<String, ServerCpu> _amdCpuByNameDictionary =
new HashMap<String, ServerCpu>();
+ private Map<String, ServerCpu> _ibmCpuByNameDictionary =
+ new HashMap<String, ServerCpu>();
private final String _intelFlag = "vmx";
private final String _amdFlag = "svm";
+ private final String _ibmFlag = "powernv";
public CpuFlagsManager(Version ver) {
InitDictionaries(ver);
@@ -140,6 +144,10 @@
if (result == null) {
result = _amdCpuByNameDictionary.get(cpuName);
}
+
+ if (result == null) {
+ result = _ibmCpuByNameDictionary.get(cpuName);
+ }
}
return result;
}
@@ -149,6 +157,7 @@
// init dictionaries
_intelCpuByNameDictionary.clear();
_amdCpuByNameDictionary.clear();
+ _ibmCpuByNameDictionary.clear();
_allCpuList.clear();
String[] cpus = Config.<String>
GetValue(ConfigValues.ServerCPUList, ver.toString()).split("[;]", -1);
@@ -179,6 +188,8 @@
_intelCpuByNameDictionary.put(sc.getCpuName(), sc);
} else if (sc.getFlags().contains(_amdFlag)) {
_amdCpuByNameDictionary.put(sc.getCpuName(), sc);
+ } else if (sc.getFlags().contains(_ibmFlag)) {
+ _ibmCpuByNameDictionary.put(sc.getCpuName(), sc);
}
_allCpuList.add(sc);
@@ -189,6 +200,7 @@
}
_intelCpuList = new
ArrayList<ServerCpu>(_intelCpuByNameDictionary.values());
_amdCpuList = new
ArrayList<ServerCpu>(_amdCpuByNameDictionary.values());
+ _ibmCpuList = new
ArrayList<ServerCpu>(_ibmCpuByNameDictionary.values());
Comparator<ServerCpu> cpuComparator = new Comparator<ServerCpu>() {
@Override
@@ -201,6 +213,7 @@
// selected first
Collections.sort(_intelCpuList, cpuComparator);
Collections.sort(_amdCpuList, cpuComparator);
+ Collections.sort(_ibmCpuList, cpuComparator);
}
public String GetVDSVerbDataByCpuName(String name) {
@@ -208,7 +221,8 @@
ServerCpu sc = null;
if (name != null) {
if ((sc = _intelCpuByNameDictionary.get(name)) != null
- || (sc = _amdCpuByNameDictionary.get(name)) != null) {
+ || (sc = _amdCpuByNameDictionary.get(name)) != null
+ || (sc = _ibmCpuByNameDictionary.get(name)) != null) {
result = sc.getVdsVerbData();
}
}
@@ -239,6 +253,7 @@
if (clusterCpuName != null
&& ((clusterCpu =
_intelCpuByNameDictionary.get(clusterCpuName)) != null
|| (clusterCpu =
_amdCpuByNameDictionary.get(clusterCpuName)) != null
+ || (clusterCpu =
_ibmCpuByNameDictionary.get(clusterCpuName)) != null
)) {
for (String flag : clusterCpu.getFlags()) {
if (!lstServerflags.contains(flag)) {
@@ -280,6 +295,8 @@
result = _intelCpuByNameDictionary.containsKey(cpuName2);
} else if (_amdCpuByNameDictionary.containsKey(cpuName1)) {
result = _amdCpuByNameDictionary.containsKey(cpuName2);
+ } else if (_ibmCpuByNameDictionary.containsKey(cpuName1)) {
+ result = _ibmCpuByNameDictionary.containsKey(cpuName2);
}
}
@@ -289,7 +306,8 @@
public boolean CheckIfCpusExist(String cpuName) {
return cpuName != null
&& (_intelCpuByNameDictionary.containsKey(cpuName)
- || _amdCpuByNameDictionary.containsKey(cpuName));
+ || _amdCpuByNameDictionary.containsKey(cpuName)
+ || _ibmCpuByNameDictionary.containsKey(cpuName));
}
/**
@@ -317,6 +335,13 @@
break;
}
}
+ } else if (lstFlags.contains(_ibmFlag)) {
+ for (int i = _ibmCpuList.size() - 1; i >= 0; i--) {
+ if (CheckIfFlagsContainsCpuFlags(_ibmCpuList.get(i),
lstFlags)) {
+ result = _ibmCpuList.get(i);
+ break;
+ }
+ }
}
return result;
}
diff --git
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java
index f5edb90..100ac4b 100644
---
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java
+++
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/ArchitectureType.java
@@ -5,7 +5,8 @@
public enum ArchitectureType implements Identifiable {
undefined(0),
- x86_64(1);
+ x86_64(1),
+ ppc64(2);
private int value;
private static final HashMap<Integer, ArchitectureType>
valueToArchitecture =
diff --git
a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/ServerCpuParserTest.java
b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/ServerCpuParserTest.java
index cf34daa..2380f5f 100644
---
a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/ServerCpuParserTest.java
+++
b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/util/ServerCpuParserTest.java
@@ -38,11 +38,11 @@
@Test
public void testParseMultipleArchtectures() {
- List<ServerCpu> cpus = parseCpus("1:foo:one,two,three:blue:x86_64;:bar
foo:four,five,six:pink:x86_64");
+ List<ServerCpu> cpus = parseCpus("1:foo:one,two,three:blue:x86_64;:bar
foo:four,five,six:pink:ppc64");
assertNotNull(cpus);
assertEquals(2, cpus.size());
verifyCpu(cpus.get(0), 1, "foo", "blue", ArchitectureType.x86_64,
"one", "two", "three");
- verifyCpu(cpus.get(1), 0, "bar foo", "pink", ArchitectureType.x86_64,
"four", "five", "six");
+ verifyCpu(cpus.get(1), 0, "bar foo", "pink", ArchitectureType.ppc64,
"four", "five", "six");
}
@Test
diff --git a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
index e62d9d1..d0a1b46 100644
--- a/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/packaging/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -77,7 +77,7 @@
select
fn_db_add_config_value('ClusterEmulatedMachines','rhel6.2.0,pc-1.0','3.0');
select
fn_db_add_config_value('ClusterEmulatedMachines','rhel6.3.0,pc-1.0','3.1');
select
fn_db_add_config_value('ClusterEmulatedMachines','rhel6.4.0,pc-1.0','3.2');
-select
fn_db_add_config_value('ClusterEmulatedMachines','rhel6.4.0,pc-1.0','3.3');
+select
fn_db_add_config_value('ClusterEmulatedMachines','rhel6.4.0,pc-1.0,pseries','3.3');
select fn_db_add_config_value('CpuOverCommitDurationMinutes','2','general');
--Handling Data directory for ENGINE
select fn_db_add_config_value('DataDir','/usr/share/engine','general');
@@ -441,7 +441,7 @@
select fn_db_add_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64;','3.0');
select fn_db_add_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64;','3.1');
select fn_db_add_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 7:Intel SandyBridge
Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64; 8:Intel
Haswell:vmx,nx,model_Haswell:Haswell:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64; 5:AMD Opteron
G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64; 6:AMD Opteron
G5:smx,nx,model_Opteron_G5:Opteron_G5:x86_64;','3.2');
-select fn_db_add_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 7:Intel SandyBridge
Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64; 8:Intel
Haswell:vmx,nx,model_Haswell:Haswell:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64; 5:AMD Opteron
G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64; 6:AMD Opteron
G5:smx,nx,model_Opteron_G5:Opteron_G5:x86_64;','3.3');
+select fn_db_add_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 7:Intel SandyBridge
Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64; 8:Intel
Haswell:vmx,nx,model_Haswell:Haswell:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64; 5:AMD Opteron
G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64; 6:AMD Opteron
G5:smx,nx,model_Opteron_G5:Opteron_G5:x86_64; 1:IBM POWER 7
v2.0:powernv,model_POWER7_v2.0:POWER7_v2.0:ppc64; 2:IBM POWER 7
v2.1:powernv,model_POWER7_v2.1:POWER7_v2.1:ppc64; 3:IBM POWER 7
v2.3:powernv,model_POWER7:POWER7:ppc64;','3.3');
select fn_db_add_config_value('ServerRebootTimeout','300','general');
select fn_db_add_config_value('SetupNetworksPollingTimeout','3','general');
-- Add shareable disk property in vdc_options to support only 3.1 version.
@@ -724,7 +724,8 @@
select fn_db_update_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64;','3.0');
select fn_db_update_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 7:Intel SandyBridge
Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64; 5:AMD Opteron
G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64;','3.1');
select fn_db_update_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 7:Intel SandyBridge
Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64; 8:Intel
Haswell:vmx,nx,model_Haswell:Haswell:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64; 5:AMD Opteron
G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64; 6:AMD Opteron
G5:smx,nx,model_Opteron_G5:Opteron_G5:x86_64;','3.2');
-select fn_db_update_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 7:Intel SandyBridge
Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64; 8:Intel
Haswell:vmx,nx,model_Haswell:Haswell:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64; 5:AMD Opteron
G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64; 6:AMD Opteron
G5:smx,nx,model_Opteron_G5:Opteron_G5:x86_64;','3.3');
+select fn_db_update_config_value('ServerCPUList','3:Intel Conroe
Family:vmx,nx,model_Conroe:Conroe:x86_64; 4:Intel Penryn
Family:vmx,nx,model_Penryn:Penryn:x86_64; 5:Intel Nehalem
Family:vmx,nx,model_Nehalem:Nehalem:x86_64; 6:Intel Westmere
Family:aes,vmx,nx,model_Westmere:Westmere:x86_64; 7:Intel SandyBridge
Family:vmx,nx,model_SandyBridge:SandyBridge:x86_64; 8:Intel
Haswell:vmx,nx,model_Haswell:Haswell:x86_64; 2:AMD Opteron
G1:svm,nx,model_Opteron_G1:Opteron_G1:x86_64; 3:AMD Opteron
G2:svm,nx,model_Opteron_G2:Opteron_G2:x86_64; 4:AMD Opteron
G3:svm,nx,model_Opteron_G3:Opteron_G3:x86_64; 5:AMD Opteron
G4:svm,nx,model_Opteron_G4:Opteron_G4:x86_64; 6:AMD Opteron
G5:smx,nx,model_Opteron_G5:Opteron_G5:x86_64; :IBM POWER 7
v2.0:powernv,model_POWER7_v2.0:POWER7_v2.0:ppc64; :IBM POWER 7
v2.1:powernv,model_POWER7_v2.1:POWER7_v2.1:ppc64; :IBM POWER 7
v2.3:powernv,model_POWER7:POWER7:ppc64;','3.3');
+select
fn_db_update_config_value('ClusterEmulatedMachines','rhel6.4.0,pc-1.0,pseries','3.3');
select fn_db_update_config_value('SpiceDriverNameInGuest','{"windows":
"RHEV-Spice", "linux" : "xorg-x11-drv-qxl" }','general');
select
fn_db_update_config_value('SupportedClusterLevels','3.0,3.1,3.2,3.3','general');
select
fn_db_update_config_value('SupportedStorageFormats','0,2,3','3.1,3.2,3.3');
--
To view, visit http://gerrit.ovirt.org/20614
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id56ef93cd377bdadc10db008618ab4bbb8ed7170
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gustavo Frederico Temple Pedrosa <[email protected]>
Gerrit-Reviewer: Vitor de Lima <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches