Martin Sivák has posted comments on this change.

Change subject: Add VdsPowerDown command and use it in Power saving policy
......................................................................


Patch Set 4:

(3 comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsPowerDownCommand.java
Line 23:     }
Line 24: 
Line 25:     @Override
Line 26:     protected boolean canDoAction() {
Line 27:         return getVds().getStatus() == VDSStatus.Maintenance && 
super.canDoAction();
It is an internal command at the moment. It is used only from the host power 
management policy and when host leaves maintenance too early, we will just skip 
the operation. It is not an error.
Line 28:     }
Line 29: 
Line 30:     /**
Line 31:      * Try to shut down the host using a clean ssh poweroff method


Line 32:      */
Line 33:     @Override
Line 34:     protected void executeCommand() {
Line 35:         setVds(null);
Line 36:         if (getVds() == null) {
It has to be in both, because canDoAction and execute are not atomic.
Line 37:             handleError("SSH power down will not be executed on host 
{0} ({1}) since it doesn't exist anymore.");
Line 38:             return;
Line 39:         }
Line 40: 


Line 38:             return;
Line 39:         }
Line 40: 
Line 41:         /* Try this only when the Host is in maintenance state */
Line 42:         if (getVds().getStatus() != VDSStatus.Maintenance) {
Yes, the state can change between canDoAction and execute
Line 43:             handleError("SSH power down will not be executed on host 
{0} ({1}) since it is not in Maintenance.");
Line 44:             return;
Line 45:         }
Line 46: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iccb9064dcfc9c20901d32a550354d66bbb0cc863
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Sivák <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Leonardo Bianconi <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[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