Allon Mureinik has posted comments on this change.

Change subject: core: Cleanup AttachDiskToVmCommand.canDoAction()
......................................................................


Patch Set 2: (2 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachDiskToVmCommand.java
Line 28: import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
Line 29: import org.ovirt.engine.core.compat.Guid;
Line 30: import org.ovirt.engine.core.dal.VdcBllMessages;
Line 31: 
Line 32: @LockIdNameAttribute
Yes - check out the commit message.
This is added in order to remove the explicit call to acquireLockInternal
Line 33: public class AttachDiskToVmCommand<T extends 
AttachDettachVmDiskParameters> extends AbstractDiskVmCommand<T> {
Line 34: 
Line 35:     private static final long serialVersionUID = -1686587389737849288L;
Line 36:     private List<PermissionSubject> permsList = null;


Line 68:         }
Line 69: 
Line 70:         if (!isVmExist() || !isVmUpOrDown() || 
!isDiskCanBeAddedToVm(disk)
Line 71:                 || !isDiskPassPciAndIdeLimit(disk)) {
Line 72:             return false;
There is no functional change: if retValue was false, we would not enter any of 
the other if statemenrs, and just return false.
These methods should update the message themselves, and if they don't - it's a 
bug, but a bug that was previously here, and nto related to /this/ patch
Line 73:         }
Line 74: 
Line 75:         if (getVmDeviceDao().exists(new VmDeviceId(disk.getId(), 
getVmId()))) {
Line 76:             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_ALREADY_ATTACHED);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6cb0cc87c82387e8b1dcac0142f3625a4cc232d2
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[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: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to