Liron Ar has posted comments on this change.
Change subject: core,webadmin: Plug disk to VM when adding a new disk
......................................................................
Patch Set 2:
(7 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java
Line 98: return false;
Line 99: }
Line 100: }
Line 101: else {
Line 102: if (getParameters().getPlugDiskToVm()) {
1. please change to "else if"
2. what about null value?
Line 103: return
failCanDoAction(VdcBllMessages.CANNOT_ADD_FLOATING_DISK_WITH_PLUG_VM_SET);
Line 104: }
Line 105: }
Line 106:
Line 403:
parameters.setStoragePoolId(getStorageDomain().getStoragePoolId());
Line 404: parameters.setParentParameters(getParameters());
Line 405: if (getVm() != null) {
Line 406: setVmSnapshotIdForDisk(parameters);
Line 407: boolean shouldPlugDisk = getVm().getStatus() ==
VMStatus.Down && (getParameters().getPlugDiskToVm() == null ||
getParameters().getPlugDiskToVm());
please export this to a method
Line 408:
getCompensationContext().snapshotNewEntity(VmDeviceUtils.addManagedDevice(new
VmDeviceId(getParameters().getDiskInfo()
Line 409: .getId(),
Line 410: getVmId()),
Line 411: VmDeviceGeneralType.DISK,
Line 555: }
Line 556:
Line 557: private void plugDiskToVmIfNeeded() {
Line 558: if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm()) &&
getVm() != null && getVm().getStatus() != VMStatus.Down) {
Line 559: HotPlugDiskToVmParameters params = new
HotPlugDiskToVmParameters(getVmId(), getParameters().getDiskInfo().getId());
as i wrote in the previous patchset, please avoid the memory lock in the
hotplug command. it's unneeded.
Line 560: VdcReturnValueBase returnValue =
Backend.getInstance().runInternalAction(VdcActionType.HotPlugDiskToVm, params);
Line 561: if (!returnValue.getSucceeded()) {
Line 562: AuditLogDirector.log(this,
AuditLogType.USER_FAILED_HOTPLUG_DISK);
Line 563: }
Line 558: if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm()) &&
getVm() != null && getVm().getStatus() != VMStatus.Down) {
Line 559: HotPlugDiskToVmParameters params = new
HotPlugDiskToVmParameters(getVmId(), getParameters().getDiskInfo().getId());
Line 560: VdcReturnValueBase returnValue =
Backend.getInstance().runInternalAction(VdcActionType.HotPlugDiskToVm, params);
Line 561: if (!returnValue.getSucceeded()) {
Line 562: AuditLogDirector.log(this,
AuditLogType.USER_FAILED_HOTPLUG_DISK);
this is needed only if the command cda failed, if the execution part failed
there should be already an audit log so that should cause duplication iirc.
Line 563: }
Line 564: }
Line 565: }
Line 566:
....................................................
File
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddDiskToVmCommandTest.java
Line 733: CanDoActionTestUtils.runAndAssertCanDoActionSuccess(command);
Line 734: }
Line 735:
Line 736: @Test
Line 737: public void testCanDoFailOnAddDiskFloatingDiskWithPlugSet() {
what about positive flow test?
Line 738: DiskImage disk = createDiskImage(1);
Line 739:
Line 740: AddDiskParameters parameters = createParameters();
Line 741: parameters.setDiskInfo(disk);
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/uicommon/popup/vm/VmDiskPopupWidget.java
Line 315: isBootableEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
Line 316: isShareableEditor = new
EntityModelCheckBoxEditor(Align.RIGHT);
Line 317: isReadOnlyEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
Line 318: isSgIoUnfilteredEditor = new
EntityModelCheckBoxEditor(Align.RIGHT);
Line 319: isPluggedEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
we already have this one which we use when attaching, can't you use it and
avoid adding a new one?
Line 320: attachEditor = new EntityModelCheckBoxEditor(Align.RIGHT);
Line 321:
Line 322: internalDiskTable = new EntityModelCellTable<ListModel>(true);
Line 323: externalDiskTable = new EntityModelCellTable<ListModel>(true);
....................................................
File
frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties
Line 918: SCHEDULING_ALL_HOSTS_FILTERED_OUT=Cannot ${action} ${type}. There is
no host that satisfies current scheduling constraints. See bellow for details:
Line 919: SCHEDULING_HOST_FILTERED_REASON=The host ${hostName} did not satisfy
${filterType} filter ${filterName}.
Line 920: VAR__FILTERTYPE__EXTERNAL=$filterType external
Line 921: VAR__FILTERTYPE__INTERNAL=$filterType internal
Line 922: POWER_MANAGEMENT_ACTION_ON_ENTITY_ALREADY_IN_PROGRESS=Cannot perform
${action}. Another power management action is already in progress.
?
--
To view, visit http://gerrit.ovirt.org/21851
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia9778bcaf21b346a55992590159cabd8d78f0c66
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Tal Nisan <[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