Michael Kublin has posted comments on this change.
Change subject: core: Added lock to VM when hot plugging/unplugging disks
(#844440)
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotPlugDiskToVmCommand.java
Line 35: }
Line 36:
Line 37: @Override
Line 38: protected boolean canDoAction() {
Line 39: disk = getDiskDao().get(getParameters().getDiskId());
acquireLock() should be here, after isVmExist()
Line 40: return isVmExist() && isVmUpOrDown() && isDiskExist(disk) &&
checkCanPerformPlugUnPlugDisk()
Line 41: && acquireLockInternal();
Line 42: }
Line 43:
Line 87: });
Line 88: setSucceeded(true);
Line 89: }
Line 90:
Line 91: @Override
Why lock is exclusive?
Line 92: protected Map<String, String> getExclusiveLocks() {
Line 93: return Collections.singletonMap(getVmId().toString(),
LockingGroup.VM.name());
Line 94: }
Line 95:
--
To view, visit http://gerrit.ovirt.org/7805
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic6ec6996b265851c7c691e1a4e68cba246df322a
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches