Lior Vernia has uploaded a new change for review. Change subject: engine: Cache VM from configuration when cloning from snapshot ......................................................................
engine: Cache VM from configuration when cloning from snapshot The previous implementation didn't cache the VM from configuration, therefore though its interfaces' vNIC profile IDs were updated, that didn't really take effect when looking for the profile to assign to the cloned interfaces. Change-Id: I37096b1e8596c7c52fc5ced61008ab1e17a6051d Bug-Url: https://bugzilla.redhat.com/1178508 Signed-off-by: Lior Vernia <lver...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromSnapshotCommand.java 1 file changed, 8 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/15/36615/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromSnapshotCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromSnapshotCommand.java index 55c469f..6a9fa51 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromSnapshotCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromSnapshotCommand.java @@ -166,14 +166,15 @@ } protected VM getVmFromConfiguration() { - VM result = null; - VdcQueryReturnValue queryReturnValue = - runInternalQuery(VdcQueryType.GetVmConfigurationBySnapshot, - new IdQueryParameters(snapshot.getId())); - if (queryReturnValue.getSucceeded()) { - result = queryReturnValue.getReturnValue(); + if (vmFromConfiguration == null) { + VdcQueryReturnValue queryReturnValue = + runInternalQuery(VdcQueryType.GetVmConfigurationBySnapshot, + new IdQueryParameters(snapshot.getId())); + if (queryReturnValue.getSucceeded()) { + vmFromConfiguration = queryReturnValue.getReturnValue(); + } } - return result; + return vmFromConfiguration; } protected SnapshotDao getSnapshotDao() { -- To view, visit http://gerrit.ovirt.org/36615 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37096b1e8596c7c52fc5ced61008ab1e17a6051d Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Lior Vernia <lver...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches