Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:Update
pacemaker.26120
bsc#1196340-0002-Refactor-scheduler-functionize...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc#1196340-0002-Refactor-scheduler-functionize-comparing-which-lrm_r.patch of Package pacemaker.26120
From 66ed57b2191ec6d7231e20602e805a0d685acd2b Mon Sep 17 00:00:00 2001 From: "Gao,Yan" <ygao@suse.com> Date: Mon, 9 May 2022 13:04:53 +0200 Subject: [PATCH 2/9] Refactor: scheduler: functionize comparing which lrm_rsc_op is newer --- include/crm/pengine/internal.h | 1 + lib/pengine/utils.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/crm/pengine/internal.h b/include/crm/pengine/internal.h index fe9a23b7e..7f47e190d 100644 --- a/include/crm/pengine/internal.h +++ b/include/crm/pengine/internal.h @@ -431,6 +431,7 @@ extern void pe_free_action(pe_action_t * action); extern void resource_location(pe_resource_t * rsc, pe_node_t * node, int score, const char *tag, pe_working_set_t * data_set); +extern int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b); extern gint sort_op_by_callid(gconstpointer a, gconstpointer b); extern gboolean get_target_role(pe_resource_t * rsc, enum rsc_role_e *role); void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, diff --git a/lib/pengine/utils.c b/lib/pengine/utils.c index c0ddc7d23..f1f71df04 100644 --- a/lib/pengine/utils.c +++ b/lib/pengine/utils.c @@ -1732,8 +1732,8 @@ resource_location(pe_resource_t * rsc, pe_node_t * node, int score, const char * return an_int; \ } while(0) -gint -sort_op_by_callid(gconstpointer a, gconstpointer b) +int +pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b) { int a_call_id = -1; int b_call_id = -1; @@ -1741,9 +1741,6 @@ sort_op_by_callid(gconstpointer a, gconstpointer b) char *a_uuid = NULL; char *b_uuid = NULL; - const xmlNode *xml_a = a; - const xmlNode *xml_b = b; - const char *a_xml_id = crm_element_value(xml_a, XML_ATTR_ID); const char *b_xml_id = crm_element_value(xml_b, XML_ATTR_ID); @@ -1846,7 +1843,15 @@ sort_op_by_callid(gconstpointer a, gconstpointer b) /* we should never end up here */ CRM_CHECK(FALSE, sort_return(0, "default")); +} + +gint +sort_op_by_callid(gconstpointer a, gconstpointer b) +{ + const xmlNode *xml_a = a; + const xmlNode *xml_b = b; + return pe__is_newer_op(xml_a, xml_b); } time_t -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor