Martin Betak has posted comments on this change.
Change subject: restapi: Start VM not as RunOnce
......................................................................
Patch Set 1:
(1 comment)
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendVmResource.java
Line 228: new VM()),
Line 229: new RunVmOnceParams(guid));
Line 230: if (action.isSetVm()) {
Line 231: validateEnums(VM.class, action.getVm());
Line 232: VM vm = action.getVm();
By looking at the VmMapper#map(org.ovirt.engine.core.common.businessentities.VM
entity, VM template) it seems to me that values are taken from the business
entity and only setters are called on resulting 'model' and there is no special
handling that if this property is overridable by RunOnce it should be taken
from the 'template' with higher priority. If I understand the behavior
correctly the RunOnce parameters should be applied ON TOP of the business
entity's properties, possibly overwriting some of them. So I guess that the
correct behavior is to first convert the entity to VM, then map the
action.getVm() to it possibly overwriting some properties specific to this
RunOnce and then map the result to RunVmOnceParams. Is there a way to achieve
this with only 2 calls to 'map'?
Line 233: params = map(vm, params);
Line 234: if (vm.isSetPlacementPolicy() &&
vm.getPlacementPolicy().isSetHost()) {
Line 235: validateParameters(vm.getPlacementPolicy(),
"host.id|name");
Line 236:
params.setDestinationVdsId(getHostId(vm.getPlacementPolicy().getHost()));
--
To view, visit http://gerrit.ovirt.org/19267
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I40be200c8742d8b31b7881926c59deaf345992ec
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <[email protected]>
Gerrit-Reviewer: Martin Betak <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Ori Liel <[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