Maor Lipchuk has posted comments on this change.
Change subject: core: update managed device map when import cloned VM.
......................................................................
Patch Set 2:
(2 comments)
> 1. Although this bug is talking about Import VM scenario, I think the same
> thing will happen in Import Vm Template, Therefore, please, fix
> ImportVmTemplateCommand either - maybe the code can be reused or open another
> bug for Template.
Agreed will also change the template
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
Line 847: * - All the disk volumes
Line 848: * @param disk
Line 849: * - The disk which is about to be cloned
Line 850: */
Line 851: private void generateNewDiskId(List<DiskImage> diskList,
DiskImage disk, Map<Guid, VmDevice> managedDeviceMap) {
Refactored to a new method, not relevant any more
Line 852: Guid newGuidForDisk = Guid.newGuid();
Line 853:
Line 854: // Copy the disk so it will preserve the old disk id and
image id.
Line 855: newDiskIdForDisk.put(newGuidForDisk, DiskImage.copyOf(disk));
Line 856:
Line 857: Guid oldDiskId = disk.getId();
Line 858: managedDeviceMap.put(newGuidForDisk,
managedDeviceMap.get(disk.getId()));
Line 859: managedDeviceMap.remove(oldDiskId);
Line 860: disk.setId(newGuidForDisk);
1. done
2. I can't remove the local variable, because then I will not have an
indication of the old id.
3. I assume it will not reflect here, we will just put null value for the disk
guid.
Line 861: disk.setImageId(Guid.newGuid());
Line 862: for (DiskImage diskImage : diskList) {
Line 863: diskImage.setId(disk.getId());
Line 864: }
--
To view, visit http://gerrit.ovirt.org/19954
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I65a99cc0783f670b9288cc9a066cda4d253492a6
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[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