Allon Mureinik has posted comments on this change.

Change subject: core : create template from VM with no snappable disks (#841534)
......................................................................


Patch Set 8: (8 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommand.java
Line 41:         getVm().setvmt_guid(VmTemplateHandler.BlankVmTemplateId);
Line 42:         
getVm().getStaticData().setQuotaId(getParameters().getVmStaticData().getQuotaId());
Line 43:         
DbFacade.getInstance().getVmStaticDAO().update(getVm().getStaticData());
Line 44:         // if there are no tasks, we can end the command right away.
Line 45:         if (getTaskIdList().isEmpty()) {
what if we attempted to create a task and failed for some reason?
Line 46:             EndSuccessfully();
Line 47:         }
Line 48:     }
Line 49: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
Line 125:                 getCompensationContext().stateChanged();
Line 126:                 return null;
Line 127:             }
Line 128:         });
Line 129: 
why is this a part of this patch?
Line 130:         TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Void>() {
Line 131: 
Line 132:             @Override
Line 133:             public Void runInTransaction() {


Line 363: 
Line 364:         for (VdcActionParametersBase p : 
getParameters().getImagesParameters()) {
Line 365:             
Backend.getInstance().EndAction(VdcActionType.CreateImageTemplate, p);
Line 366:         }
Line 367:         if (reloadVmTemplateFromDB() != null) {
can this really ever be null?
Line 368:             endDefaultOperations();
Line 369:         }
Line 370:         setSucceeded(true);
Line 371:     }


Line 366:         }
Line 367:         if (reloadVmTemplateFromDB() != null) {
Line 368:             endDefaultOperations();
Line 369:         }
Line 370:         setSucceeded(true);
also, isn't this entire block just "endSuccessfullySynchronous()"?
Line 371:     }
Line 372: 
Line 373:     private void endSuccessfullySynchronous() {
Line 374:         if (reloadVmTemplateFromDB() != null) {


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ExportVmTemplateCommand.java
Line 87:                 retVal = false;
Line 88:             }
Line 89:         }
Line 90: 
Line 91:         if (!getVmTemplate().getDiskList().isEmpty()) {
Not sure I understand the logic here.
please explain?
Line 92:             retVal = retVal && super.canDoAction();
Line 93:         }
Line 94: 
Line 95:         // check if template (with no override option)


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
Line 253:                 return null;
Line 254:             }
Line 255:         });
Line 256: 
Line 257:         boolean isVmTemplateContainImages = 
!getParameters().getImages().isEmpty();
s/is/does/
Line 258:         if (isVmTemplateContainImages) {
Line 259:             MoveOrCopyAllImageGroups(getVmTemplateId(), 
getParameters().getImages());
Line 260:         }
Line 261: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmTemplateCommand.java
Line 180:             // Set VM to lock status immediately, for reducing race 
condition.
Line 181:             
VmTemplateHandler.lockVmTemplateInTransaction(getVmTemplateId(), 
getCompensationContext());
Line 182:             // if for some reason template doesn't have images, 
remove it now and not in end action
Line 183:             final boolean hasImages = imageTemplates.size() > 0;
Line 184:             if 
(RemoveTemplateInSpm(getVmTemplate().getstorage_pool_id().getValue(), 
getVmTemplateId())) {
does issuing an spm command even make sense if there are no images?
Line 185:                 if (hasImages) {
Line 186:                     TransactionSupport.executeInNewTransaction(new 
TransactionMethod<Void>() {
Line 187: 
Line 188:                         @Override


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/NewTemplateVmModelBehavior.java
Line 120
Line 121
Line 122
Line 123
Line 124
Can this constant be removed too?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie825ea39fee6d6d5c86f9c82f3008fa314392ed2
Gerrit-PatchSet: 8
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: Tal Nisan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to