Tomas Jelinek has uploaded a new change for review.

Change subject: engine: clone VM from snapshot corrupts original VM
......................................................................

engine: clone VM from snapshot corrupts original VM

The problem was in AddVmFromSnapshotCommand which calls
VmDeviceUtils.copyVmDevices which accepts the following params:
srcId, destId, destVm, destVmBase
but it was called with:
srcId, destId, srcVm, srcVmBase

In most cases the srcId and destId is used but in some cases
also the entities themselfs which caused to copy the devices
from source VM to itself which corrupted it.

This regression has been introduced by:
4864cbe79e63475216baf165d3ff8681769822c0

Change-Id: I60dddf57f7f2cf9ec8a3a429d97e84c3bbcc12b2
Bug-Url: https://bugzilla.redhat.com/982636
Signed-off-by: Tomas Jelinek <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromSnapshotCommand.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/07/17007/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 2627b2b..b2c6ef8 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
@@ -241,8 +241,8 @@
         devices.addAll(vmFromConfiguration.getManagedVmDeviceMap().values());
         VmDeviceUtils.copyVmDevices(getVmIdFromSnapshot(),
                 getVmId(),
-                vmFromConfiguration,
-                vmFromConfiguration.getStaticData(),
+                getVm(),
+                getVm().getStaticData(),
                 true,
                 devices,
                 newDiskImages,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60dddf57f7f2cf9ec8a3a429d97e84c3bbcc12b2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to