Daniel Erez has posted comments on this change.
Change subject: core: GetAllVmSnapshotsFromConfigurationByVmIdQuery
......................................................................
Patch Set 5:
(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();
We use non-static methods in helpers for testing..
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) {
I'll add java doc - any suggestion for better naming?
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) {
I was uncertain about the naming here myself, but I think it's the best of a
bad lot as it similar to the following method - getVmWithoutConfiguration :)
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
OK, though not related to the patch - copied from the query.
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 <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches