Maor Lipchuk has posted comments on this change. Change subject: wip: core: remove as sync verb. ......................................................................
Patch Set 4: (5 inline comments) 1) After this change of behavior, there is logic which should need to be deleted. The boolean noImagesRemovedYet is not relevant any more because now tasks will not keep the VM nor images in locked status. This boolean is used at RemoveAllVmImagesCommand, RemoveAllVmTemplateImagesTemplatesCommand and RestoreAllSnapshotsCommand and should now be removed. 2) I still think that the case of engine restart in the middle of removing VM/Template with non existing images should be addressed, but I guess that should not block this change. .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskCommand.java Line 259: DiskImage diskImage = getDiskImage(); Line 260: RemoveImageParameters p = new RemoveImageParameters(diskImage.getImageId()); Line 261: p.setTransactionScopeOption(TransactionScopeOption.Suppress); Line 262: p.setDiskImage(diskImage); Line 263: p.setParentCommand(VdcActionType.RemoveDisk); isRemoveDuringExecution can be removed from the parameters class Line 264: p.setEntityId(getParameters().getEntityId()); Line 265: p.setParentParameters(getParameters()); Line 266: p.setRemoveFromSnapshots(true); Line 267: p.setStorageDomainId(getParameters().getStorageDomainId()); .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveImageCommand.java Line 82 Line 83 Line 84 Line 85 Line 86 isRemoveDuringExecution can be removed from the parameters class Line 85: getParameters().getParentCommand(), Line 86: VdcObjectType.Storage, Line 87: getParameters().getStorageDomainId())); Line 88: } catch (VdcBLLException e) { Line 89: if (e.getErrorCode() != VdcBllErrors.ImageDoesNotExistInDomainError) { Log should be added here if we get VdcBllErrors.ImageDoesNotExistInDomainError Line 90: throw e; Line 91: } Line 92: } Line 93: .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmCommand.java Line 230: public AuditLogType getAuditLogTypeValue() { Line 231: switch (getActionState()) { Line 232: case EXECUTE: Line 233: return getSucceeded() ? AuditLogType.USER_REMOVE_VM_FINISHED : (hasImages ? AuditLogType. Line 234: USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS : AuditLogType.USER_FAILED_REMOVE_VM); It looks like if VM doesn't have any images we print that user failed to remove VM Line 235: case END_FAILURE: Line 236: case END_SUCCESS: Line 237: default: Line 238: return disksLeftInVm.isEmpty() ? AuditLogType.USER_REMOVE_VM_FINISHED Line 234: USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS : AuditLogType.USER_FAILED_REMOVE_VM); Line 235: case END_FAILURE: Line 236: case END_SUCCESS: Line 237: default: Line 238: return disksLeftInVm.isEmpty() ? AuditLogType.USER_REMOVE_VM_FINISHED Now the audit log will be printed twice. Once when the disks will be removed and after when the tasks will be finished Line 239: : AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS; Line 240: } Line 241: } Line 242: -- To view, visit http://gerrit.ovirt.org/13611 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic822a92acb8231d2ca84ae092bd98659507925d8 Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Alissa Bonas <abo...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Ayal Baron <aba...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches