Michael Kublin has posted comments on this change.
Change subject: core: NPEs in AddVmTemplate.endSuccesfully after engine crash
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
Line 113:
Line 114: VmHandler.LockVm(vmDynamic, getCompensationContext());
Line 115: setActionReturnValue(Guid.Empty);
Line 116: setVmTemplateId(Guid.NewGuid());
Line 117: getParameters().setVmTemplateId(getVmTemplateId());
Replying to myself, about a wrong statement that I did. The parameters was
missed, because of JSON serializations, the getters and setters should have a
similar name like setVmTemplateId() and getVmTemplateId(). Please move this to
the commit message as a reason for the bug, and after that please find a real
reason why vmId is not passed, even it is located on parameters.
Line 118: getParameters().setEntityId(getVmTemplateId());
Line 119:
Line 120: TransactionSupport.executeInNewTransaction(new
TransactionMethod<Void>() {
Line 121:
Line 361:
Line 362: @Override
Line 363: protected void endSuccessfully() {
Line 364: setVmTemplateId(getParameters().getVmTemplateId());
Line 365:
setVmId(((CreateImageTemplateParameters)getParameters().getImagesParameters().get(0)).getVmId());
(writing with out grammar errors or almost without) Why I need setVmId, if it
is passed via parameters? For help look at constructor of command . The command
is making a template from vm, so vmId is passed to command and should not be
retrieved from some other parameters.
Line 366: for (VdcActionParametersBase p :
getParameters().getImagesParameters()) {
Line 367:
Backend.getInstance().EndAction(VdcActionType.CreateImageTemplate, p);
Line 368: }
Line 369: if (reloadVmTemplateFromDB() != null) {
--
To view, visit http://gerrit.ovirt.org/9106
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I12c40cd3736a0516473de223ec84301f84983d3b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Aravot <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches