[pve-devel] [PATCH v3 ha-manager 6/9] Add stop command to simulation

Fabian Ebner f.ebner at proxmox.com
Wed Oct 2 11:46:07 CEST 2019


Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 src/PVE/HA/Sim/Hardware.pm | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm
index 3cdc85b..121cd1b 100644
--- a/src/PVE/HA/Sim/Hardware.pm
+++ b/src/PVE/HA/Sim/Hardware.pm
@@ -541,6 +541,7 @@ sub get_cfs_state {
 # restart-lrm <node>
 # service <sid> <started|disabled|stopped|ignored>
 # service <sid> <migrate|relocate> <target>
+# service <sid> stop <timeout>
 # service <sid> lock/unlock [lockname]
 
 sub sim_hardware_cmd {
@@ -658,6 +659,13 @@ sub sim_hardware_cmd {
 
 		$self->queue_crm_commands_nolock("$action $sid $param");
 
+	    } elsif ($action eq 'stop') {
+
+		die "sim_hardware_cmd: missing timeout for '$action' command"
+		    if !defined($param);
+
+		$self->queue_crm_commands_nolock("$action $sid $param");
+
 	    } elsif ($action eq 'add') {
 
 		$self->add_service($sid, {state => 'started', node => $param});
-- 
2.20.1





More information about the pve-devel mailing list