Liron Ar has posted comments on this change.

Change subject: engine: Do not add disk in snapshot preview
......................................................................


Patch Set 5: Looks good to me, but someone else must approve

(1 inline comment)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java
Line 128:         if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != 
null) {
Line 129:             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE);
Line 130:         }
Line 131: 
Line 132:         if (getVm() != null && !(isVmNotInPreviewSnapshot() && 
isVmNotLocked())) {
can you just change the order of the checks? it will eliminate further db 
queries (isVmNotInPreviewSnapshot()/isVmNotLocked()) - as the vm is already 
fetched in getVM()
Line 133:             return false;
Line 134:         }
Line 135: 
Line 136:         return true;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibfde0540f1d77456ed1412b015a0963f4682039f
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Libor Spevak <lspe...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Libor Spevak <lspe...@redhat.com>
Gerrit-Reviewer: Liron Ar <lara...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Vered Volansky <vvola...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to