Ori Liel has posted comments on this change.

Change subject: core, engine, webadmin: Initial support for alternative 
architectures
......................................................................


Patch Set 7:

(2 comments)

....................................................
File 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/ClusterMapper.java
Line 46:         if (model.isSetCpu() && model.getCpu().isSetId()) {
Line 47:             entity.setcpu_name(model.getCpu().getId());
Line 48:         }
Line 49:         if (model.isSetCpu() && model.getCpu().isSetArchitecture()) {
Line 50:             Architecture archType = 
Architecture.fromValue(model.getCpu().getArchitecture());
For consistency, I think it's better to use the explicit mapping method for 
this enum, which you have added below:

Architecture architecture = 
Architecture.fromValue(model.getCpu().getArchitecture());
if (architecture != null) {
       entity.setArchitecture(map(architecture, null));
}
Line 51: 
Line 52:             if (archType != null) {
Line 53:                 entity.setArchitecture(map(archType, null));
Line 54:             }


....................................................
File 
backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/TemplateMapper.java
Line 85:         if (model.isSetCpu() && model.getCpu().isSetArchitecture()) {
Line 86:             Architecture archType = 
Architecture.fromValue(model.getCpu().getArchitecture());
Line 87: 
Line 88:             if (archType != null) {
Line 89:                 entity.setClusterArch(ClusterMapper.map(archType, 
null));
It's good that the code isn't duplicated. It would be even nicer to create a 
new mapper for CPU and invoke it from Cluster, Template and VM mappers. Up to 
you.
Line 90:             }
Line 91:         }
Line 92:         if (model.isSetCpuShares()) {
Line 93:             entity.setCpuShares(model.getCpuShares());


-- 
To view, visit http://gerrit.ovirt.org/18938
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1ecd642e2bc05067d55884c948bdaeb6e7838c26
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vitor de Lima <[email protected]>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa 
<[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Leonardo Bianconi <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Ori Liel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: Vitor de Lima <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to