Sergey Gotliv has posted comments on this change.
Change subject: core, restapi: Introducing support for attaching disk snapshot
......................................................................
Patch Set 28:
(3 comments)
I only reviewed UpdateVmDiskCommand. I don't understand the impact of this
feature on others, like Resize. Is it tested?
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java
Line 60: private List<VM> vmsDiskOrSnapshotPluggedTo;
Line 61: /* vms that a disk or it's sansphot is attached to. */
Line 62: private List<VM> vmsDiskOrSnapshotAttachedTo;
Line 63: /* vm device for the given vm and disk. */
Line 64: private VmDevice vmDeviceForVm;
These comments are redundant with the variable names.
Line 65: private Disk oldDisk;
Line 66:
Line 67: public UpdateVmDiskCommand(T parameters) {
Line 68: super(parameters);
Line 549: return vmsDiskSnapshotPluggedTo;
Line 550: }
Line 551:
Line 552: private void loadVmDiskAttachedToInfo() {
Line 553: if (getOldDisk() != null) {
Please, remove the null check.
Why getOldDisk() would be null? It supposed to update the old disk - if its
null, this is probably an issue.
Line 554: vmsDiskSnapshotPluggedTo = new LinkedList<>();
Line 555: vmsDiskPluggedTo = new LinkedList<>();
Line 556: vmsDiskOrSnapshotPluggedTo = new LinkedList<>();
Line 557: vmsDiskOrSnapshotAttachedTo = new LinkedList<>();
Line 555: vmsDiskPluggedTo = new LinkedList<>();
Line 556: vmsDiskOrSnapshotPluggedTo = new LinkedList<>();
Line 557: vmsDiskOrSnapshotAttachedTo = new LinkedList<>();
Line 558:
Line 559: List<Pair<VM, VmDevice>> attachedVmsInfo =
getVmDAO().getVmsWithPlugInfo(getOldDisk().getId());
This method is called from constructor, can you avoid loading staff from DB
here?
Line 560: for (Pair<VM, VmDevice> pair : attachedVmsInfo) {
Line 561: VM vm = pair.getFirst();
Line 562: vmsDiskOrSnapshotAttachedTo.add(vm);
Line 563: if (pair.getSecond().getIsPlugged() == Boolean.TRUE) {
--
To view, visit http://gerrit.ovirt.org/17679
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I02579bf1a91cd294a5040acf432f1fdb87eb18c1
Gerrit-PatchSet: 28
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[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
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches