Maor Lipchuk has posted comments on this change.

Change subject: core: GetAllVmSnapshotsFromConfigurationByVmIdQuery
......................................................................


Patch Set 5: Code-Review+1

(4 comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmConfigurationBySnapshotQuery.java
Line 38:         return getDbFacade().getSnapshotDao();
Line 39:     }
Line 40: 
Line 41:     protected SnapshotVmConfigurationHelper 
getSnapshotVmConfigurationHelper() {
Line 42:         return new SnapshotVmConfigurationHelper();
I would use static methods for SnapshotVmConfigurationHelper, or just use lazy 
static instant in the class
Line 43:     }
Line 44: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/snapshots/SnapshotVmConfigurationHelper.java
Line 23: public class SnapshotVmConfigurationHelper {
Line 24: 
Line 25:     private static final Log log = 
LogFactory.getLog(SnapshotVmConfigurationHelper.class);
Line 26: 
Line 27:     public VM getVmFromConfiguration(String configuration, Guid vmId, 
Guid snapshotId) {
The method name is misleading, if the configuration is null we will get the VM 
by the snapshot id.

This should be mentioned in a java doc or change the method name to indicate it
Line 28:         VM vm = null;
Line 29:         if (configuration != null) {
Line 30:             vm = getVmWithConfiguration(configuration, vmId);
Line 31:             markImagesIllegalIfNotInDb(vm, snapshotId);


Line 37: 
Line 38:         return vm;
Line 39:     }
Line 40: 
Line 41:     protected VM getVmWithConfiguration(String configuration, Guid 
vmId) {
maybe the old name is better "getVmFromConfiguration" (You also call here to  
updateVm*From*Configuration)
Line 42:         VM result = getVmDao().get(vmId);
Line 43:         getSnapshotManager().updateVmFromConfiguration(result, 
configuration);
Line 44:         return result;
Line 45:     }


Line 49:      * snapshots which were taken in old engine where full OVF 
snapshot metadata was not supported.
Line 50:      *
Line 51:      * See also {@link VmHandler#updateDisksForVm(VM, java.util.List)}
Line 52:      *
Line 53:      * @return a VM model
VM model is in the GUI IINM.

Why not changing it to simple "a VM"
Line 54:      */
Line 55:     protected VM getVmWithoutConfiguration(Guid vmId, Guid snapshotId) 
{
Line 56:         VM vm = getVmDao().get(vmId);
Line 57:         List<VmNetworkInterface> interfaces = 
getVmNetworkInterfaceDao().getAllForVm(vm.getId());


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I23aa4de4d233fade33d2a5ea174a9a1802b49370
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@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: Tal Nisan <tni...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to