Sergey Gotliv has posted comments on this change.
Change subject: core: Sync VM disks with new guid when importing a VM.
......................................................................
Patch Set 1: (3 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
Line 101: private List<DiskImage> imageList;
Line 102:
Line 103: /*
Line 104: * Map which contains the disk guid (new if cloned) and the disk
parameters from the export domain.
Line 105: */
I don't understand this comment and the variable name. Using "guid" in the
variable name is redundant, I can see it from the type, id is probably better,
but I am not insist.
How about diskId2OriginalDisk or diskIdToOriginalDisk or
diskIdToDiskInExportDomain?
Line 106: private final Map<Guid, DiskImage> newDiskGuidForDisk = new
HashMap<>();
Line 107: private final List<String> macsAdded = new ArrayList<String>();
Line 108: private final SnapshotsManager snapshotsManager = new
SnapshotsManager();
Line 109:
Line 727: MoveOrCopyImageGroupParameters params = new
MoveOrCopyImageGroupParameters(containerID,
Line 728: originalDiskId,
Line 729: newDiskGuidForDisk.get(disk.getId()).getImageId(),
Line 730: disk.getId(),
Line 731: disk.getImageId(),
Do we have here the pair of original diskId/imageId and pair of new
diskId/imageId?
Line 732: destinationDomain, getMoveOrCopyImageOperation());
Line 733: params.setParentCommand(getActionType());
Line 734: params.setUseCopyCollapse(getParameters().getCopyCollapse());
Line 735: params.setCopyVolumeType(CopyVolumeType.LeafVol);
Line 814:
Line 815: private void resetNewIdForDisk(List<DiskImage> diskList,
DiskImage disk) {
Line 816: Guid newGuidForDisk = Guid.newGuid();
Line 817:
Line 818: // Copy the disk so it will preserve the old disk id and
image id.
So this is not just reset, this is reset and preserve, consider leave the
"preserve" part in the caller method?
Line 819: newDiskGuidForDisk.put(newGuidForDisk,
DiskImage.copyOf(disk));
Line 820: disk.setId(newGuidForDisk);
Line 821: disk.setImageId(Guid.newGuid());
Line 822: for (int i = 0; i < diskList.size() - 1; i++) {
--
To view, visit http://gerrit.ovirt.org/17042
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If47f87b480d01dfd426a1aa24ddf48d75d3ff334
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[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: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches