File bsc#1181744-0003-Refactor-fencing-new-function-stonith_op_state_pendi.patch of Package pacemaker.21295

From 234ac5db32f85edd73613684970f8ccfc7265830 Mon Sep 17 00:00:00 2001
From: "Gao,Yan" <ygao@suse.com>
Date: Fri, 19 Feb 2021 11:09:22 +0100
Subject: [PATCH 3/4] Refactor: fencing: new function
 stonith_op_state_pending() for checking if a fencing operation is in pending
 state

---
 include/crm/fencing/internal.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/include/crm/fencing/internal.h b/include/crm/fencing/internal.h
index dfb1d640a..83bd33442 100644
--- a/include/crm/fencing/internal.h
+++ b/include/crm/fencing/internal.h
@@ -198,4 +198,18 @@ bool stonith__event_state_pending(stonith_history_t *history, void *user_data);
 bool stonith__event_state_eq(stonith_history_t *history, void *user_data);
 bool stonith__event_state_neq(stonith_history_t *history, void *user_data);
 
+/*!
+ * \internal
+ * \brief Is a fencing operation in pending state?
+ *
+ * \param[in] state     State as enum op_state value
+ *
+ * \return A boolean
+ */
+static inline bool
+stonith__op_state_pending(enum op_state state)
+{
+    return state != st_failed && state != st_done;
+}
+
 #endif
-- 
2.26.2

openSUSE Build Service is sponsored by