From ed5e7eea8172069f41c8274f10f3cdd1c09fed41 Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Feb 24 2021 16:08:55 +0000 Subject: Refactor: scheduler: add and parse "critical" resource meta-attribute Semantics not yet implemented. --- diff --git a/include/crm/msg_xml.h b/include/crm/msg_xml.h index c8b528b..d5ac418 100644 --- a/include/crm/msg_xml.h +++ b/include/crm/msg_xml.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2020 the Pacemaker project contributors + * Copyright 2004-2021 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -217,6 +217,7 @@ extern "C" { # define XML_RSC_ATTR_REMOTE_RA_ADDR "addr" # define XML_RSC_ATTR_REMOTE_RA_SERVER "server" # define XML_RSC_ATTR_REMOTE_RA_PORT "port" +# define XML_RSC_ATTR_CRITICAL "critical" # define XML_REMOTE_ATTR_RECONNECT_INTERVAL "reconnect_interval" diff --git a/include/crm/pengine/pe_types.h b/include/crm/pengine/pe_types.h index 1416cee..7d90c42 100644 --- a/include/crm/pengine/pe_types.h +++ b/include/crm/pengine/pe_types.h @@ -251,6 +251,7 @@ struct pe_node_s { # define pe_rsc_stop 0x00001000ULL # define pe_rsc_reload 0x00002000ULL # define pe_rsc_allow_remote_remotes 0x00004000ULL +# define pe_rsc_critical 0x00008000ULL # define pe_rsc_failed 0x00010000ULL # define pe_rsc_runnable 0x00040000ULL diff --git a/lib/pengine/complex.c b/lib/pengine/complex.c index cfb06bf..3e63510 100644 --- a/lib/pengine/complex.c +++ b/lib/pengine/complex.c @@ -561,6 +561,11 @@ common_unpack(xmlNode * xml_obj, pe_resource_t ** rsc, value = g_hash_table_lookup((*rsc)->meta, XML_CIB_ATTR_PRIORITY); (*rsc)->priority = crm_parse_int(value, "0"); + value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_CRITICAL); + if ((value == NULL) || crm_is_true(value)) { + pe__set_resource_flags(*rsc, pe_rsc_critical); + } + value = g_hash_table_lookup((*rsc)->meta, XML_RSC_ATTR_NOTIFY); if (crm_is_true(value)) { pe__set_resource_flags(*rsc, pe_rsc_notify);