Liron Ar has posted comments on this change.
Change subject: core: wip: handle failed import of template
......................................................................
Patch Set 2: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
Line 134: if (!retVal) {
Line 135: break;
Line 136: } else {
Line 137:
image.setStoragePoolId(getParameters().getStoragePoolId());
Line 138: image.setStorageIds(new
ArrayList<Guid>(Arrays.asList(storageDomain.getId())));
it persists the image with the target storage domain id,
in the previous code, the image was persisted with the source domain id (which
means - the export domain), and only in the end method the mapping was
corrected to the target domain.
in case of failure in removing the image after a failed import, we want it to
be with the correct storage domain so we would be able to remove it again.
instead of having the "update domain mapping" to be executed as the operation
completes, i preferred to save it with the correct storage domain to begin with.
Line 139: imageMap.put(image.getImageId(), image);
Line 140: }
Line 141: }
Line 142: getVmTemplate().setDiskImageMap(imageMap);
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyImageGroupCommand.java
Line 190: @Override
Line 191: protected void revertTasks() {
Line 192: // Revert should be performed only for AddVmFromSnapshot at
this point.
Line 193: if (getParameters().getParentCommand() ==
VdcActionType.AddVmFromSnapshot || getParameters().getParentCommand() ==
VdcActionType.ImportVm
Line 194: || getParameters().getParentCommand() ==
VdcActionType.ImportVmTemplate) {
I agree, i already have a different patch to unify the behaviour in this method
http://gerrit.ovirt.org/#/c/12689/ and to make it more readable
Line 195: Guid destImageId =
getParameters().getDestinationImageId();
Line 196: RemoveImageParameters removeImageParams =
Line 197: new RemoveImageParameters(destImageId);
Line 198: if (getParameters().getParentCommand() ==
VdcActionType.AddVmFromSnapshot) {
--
To view, visit http://gerrit.ovirt.org/14839
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If90414b6c50d922b510a10e20e0774bdbec9c05b
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches