Allon Mureinik has posted comments on this change.
Change subject: core,ui: prevent cow shareable disk creation (#848021)
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(5 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java
Line 127: getReturnValue().getCanDoActionMessages().add(
Line 128: String.format("$max_disk_size %1$s",
Config.<Integer> GetValue(ConfigValues.MaxBlockDiskSize)));
Line 129: returnValue = false;
Line 130: }
Line 131: if (getParameters().getDiskInfo().isShareable()) {
I'd use early return in this entire block - would be more readable.
Line 132: if (returnValue && !Config.<Boolean>
GetValue(ConfigValues.ShareableDiskEnabled,
Line 133:
getStoragePool().getcompatibility_version().getValue())) {
Line 134: returnValue = false;
Line 135:
addCanDoActionMessage(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL);
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddDiskToVmCommandTest.java
Line 407: *
Line 408: * @param compatibilityVersion
Line 409: * @return
Line 410: */
Line 411: private storage_pool mockStoragePool(Version
compatibilityVersion) {
I think this can be static.
Line 412: Guid storagePoolId = Guid.NewGuid();
Line 413: storage_pool storagePool = new storage_pool();
Line 414: storagePool.setId(storagePoolId);
Line 415: storagePool.setcompatibility_version(compatibilityVersion);
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateVmDiskCommandTest.java
Line 186: *
Line 187: * @param compatibilityVersion
Line 188: * @return
Line 189: */
Line 190: private storage_pool mockStoragePool(Version
compatibilityVersion) {
this can be static
Line 191: Guid storagePoolId = Guid.NewGuid();
Line 192: storage_pool storagePool = new storage_pool();
Line 193: storagePool.setId(storagePoolId);
Line 194: storagePool.setcompatibility_version(compatibilityVersion);
Line 214:
Line 215: /**
Line 216: * The following method will create a new DiskImage
Line 217: */
Line 218: private DiskImage createDiskImage() {
this can be static
Line 219: DiskImage disk = new DiskImage();
Line 220: disk.setId(diskImageGuid);
Line 221: return disk;
Line 222: }
Line 223:
Line 224: /**
Line 225: * The following method will create a Shareable DiskImage that is
COW formatted
Line 226: */
Line 227: private DiskImage createShareableCowDisk() {
this can be static
Line 228: DiskImage disk = new DiskImage();
Line 229: disk.setId(diskImageGuid);
Line 230: disk.setvolume_format(VolumeFormat.COW);
Line 231: disk.setShareable(true);
--
To view, visit http://gerrit.ovirt.org/7462
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie9594978c0b509fd540803e9dc4137266bd0501b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches