Moti Asayag has posted comments on this change.
Change subject: core: Block Hotplug Nic in Certain Vm States (#826931)
......................................................................
Patch Set 1: (3 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotPlugUnplugVmNicCommand.java
Line 32: if (isVmUpDownOrPoweringUp(getVm().getstatus())) {
Line 33: setVdsId(getVm().getrun_on_vds().getValue());
Line 34: returnValue = isHotPlugSupported() &&
isOSSupportingHotPlug();
Line 35: } else {
Line 36:
addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL);
please add specific error message for nic plug actions which specifies the
valid statues for this action.
Line 37: returnValue = false;
Line 38: }
Line 39:
Line 40: if (returnValue) {
Line 78: VdcBllMessages.VAR__ACTION__ACTIVATE :
VdcBllMessages.VAR__ACTION__DEACTIVATE);
Line 79: addCanDoActionMessage(VdcBllMessages.VAR__TYPE__INTERFACE);
Line 80: }
Line 81:
Line 82: private boolean isVmUpDownOrPoweringUp(VMStatus vmStatus) {
I'd rename the method name to reveal it target rather implementation, e.g.
isVmStatusApplicableForPlugAction / isPlugActionSupportVmStatus
or any other variation which describe the method.
Line 83: return vmStatus == VMStatus.Up || vmStatus == VMStatus.Down ||
vmStatus == VMStatus.PoweringUp;
Line 84: }
Line 79: addCanDoActionMessage(VdcBllMessages.VAR__TYPE__INTERFACE);
Line 80: }
Line 81:
Line 82: private boolean isVmUpDownOrPoweringUp(VMStatus vmStatus) {
Line 83: return vmStatus == VMStatus.Up || vmStatus == VMStatus.Down ||
vmStatus == VMStatus.PoweringUp;
IMO Hot plug/unplug shouldn't be used when the Vm is down.
Line 84: }
--
To view, visit http://gerrit.ovirt.org/7176
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id759ca8152b455047c9c83447f526aaccdd77d6c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Muli Salem <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Muli Salem <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches