Maor Lipchuk has posted comments on this change.

Change subject: core: Removing template with disks ends with unused data in the 
db
......................................................................


Patch Set 1: Looks good to me, approved

(1 inline comment)

Please address the comments in other patch

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveAllVmTemplateImageTemplatesCommand.java
Line 75:             // remove images from db only if removing template 
completely
Line 76:             if (getParameters().isRemoveTemplateFromDb()) {
Line 77:                 DiskImage diskImage = 
DbFacade.getInstance().getDiskImageDao().get(template.getImageId());
Line 78:                 if (diskImage != null) {
Line 79:                     
DbFacade.getInstance().getBaseDiskDao().remove(template.getId());
I would also change this cinfusing variable name from template to  
templateImage.

Also change DbFacade.getInstance() to getDbFacade
Line 80:                     DbFacade.getInstance()
Line 81:                             .getVmDeviceDao()
Line 82:                             .remove(new 
VmDeviceId(diskImage.getImageId(), getVmTemplateId()));
Line 83:                     
DbFacade.getInstance().getImageStorageDomainMapDao().remove(diskImage.getImageId());


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I86573e91885085bcdfc30ee4e966590901a62067
Gerrit-PatchSet: 1
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

Reply via email to