Sergey Gotliv has posted comments on this change.

Change subject: engine: Validate that IDE disk is not read-only
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.ovirt.org/#/c/23953/5/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java:

Line 100:             return 
failCanDoAction(VdcBllMessages.CANNOT_ADD_FLOATING_DISK_WITH_PLUG_VM_SET);
Line 101:         }
Line 102: 
Line 103:         DiskValidator diskValidator = 
getDiskValidator(getParameters().getDiskInfo());
Line 104:         if 
(!validate(diskValidator.isReadOnlyPropertyCompatibleWithInterface())) {
> adding this check there will reduce 90% percent of the code in this patch, 
I completely understand you opinion.

1. Code percentage is not relevant.

2. Today we already have 2 methods in DiskValidator that validates interfaces:
isDiskInterfaceSupported and isVirtIoScsiValid. 
Indeed it sounds reasonable to have isVirtioScsiValid and 
isOsSupportsDiskInterface and then expose both of them from 
isDiskInterfaceSupported, but is it really so important?! 

In my case I don't try to validate if interface is supported or not, but 
whether this disk can be read only or not under certain circumstances. If 
tomorrow I will discover that read-only is not valid under additional 
circumstances I'll refactor it to isReadOnlySupported....
Line 105:             return false;
Line 106:         }
Line 107: 
Line 108:         if (DiskStorageType.IMAGE == 
getParameters().getDiskInfo().getDiskStorageType()) {


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I441362adf2f4833b034ede4093fc8195debd2ed5
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Cheryn Tan <[email protected]>
Gerrit-Reviewer: Daniel Erez <[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: Vered Volansky <[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

Reply via email to