Michael Kublin has posted comments on this change.

Change subject: core: Forbid attaching a locked disk to a VM
......................................................................


Patch Set 5: I would prefer that you didn't submit this

(1 inline comment)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachDiskToVmCommand.java
Line 59:         boolean isImageDisk = disk.getDiskStorageType() == 
DiskStorageType.IMAGE;
Line 60:         if (isImageDisk && ((DiskImage) disk).getimageStatus() == 
ImageStatus.ILLEGAL) {
Line 61:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_DISK_OPERATION);
Line 62:             return false;
Line 63:         }
These is in wrong place.
The check for disk status should be done after  acquireLockInternal() in order 
to prevent races. Also I think it is better to make a method for check
Line 64:         if (isImageDisk && ((DiskImage) disk).getimageStatus() == 
ImageStatus.LOCKED) {
Line 65:             
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_LOCKED);
Line 66:             addCanDoActionMessage(String.format("$%1$s %2$s", 
"diskAlias", disk.getDiskAlias()));
Line 67:             return false;


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I109654547b68da245a5fdc2b2188feedd45c2ca7
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Asaf Shakarchi <a...@redhat.com>
Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com>
Gerrit-Reviewer: Asaf Shakarchi <a...@redhat.com>
Gerrit-Reviewer: Daniel Erez <de...@redhat.com>
Gerrit-Reviewer: Michael Kublin <mkub...@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