File pacemaker#3409-0004-Low-scheduler-deprecate-support-for-default-instance.patch of Package pacemaker.38493
From 68d86f7b56075e0e051551709127995ed2eb13db Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Thu, 14 Mar 2024 16:34:47 -0500
Subject: [PATCH 4/7] Low: scheduler: deprecate support for default instance
attributes
The schema already prevents them, but the code currently processes them
if validation is disabled
---
include/crm/common/scheduler_internal.h | 1 +
lib/pengine/complex.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
Index: pacemaker-2.1.5+20221208.a3f44794f/lib/pengine/complex.c
===================================================================
--- pacemaker-2.1.5+20221208.a3f44794f.orig/lib/pengine/complex.c
+++ pacemaker-2.1.5+20221208.a3f44794f/lib/pengine/complex.c
@@ -213,6 +213,19 @@ get_rsc_attributes(GHashTable *meta_hash
get_rsc_attributes(meta_hash, rsc->parent, node, data_set);
} else {
+ if (first_named_child(data_set->rsc_defaults,
+ XML_TAG_ATTR_SETS) != NULL) {
+ /* Not possible with schema validation enabled
+ *
+ * @COMPAT Drop support when we can break behavioral
+ * backward compatibility
+ */
+ pe_warn_once(pe_wo_instance_defaults,
+ "Support for " XML_TAG_ATTR_SETS " in "
+ XML_CIB_TAG_RSCCONFIG " is deprecated and will be "
+ "removed in a future release");
+ }
+
/* and finally check the defaults */
pe__unpack_dataset_nvpairs(data_set->rsc_defaults, XML_TAG_ATTR_SETS,
&rule_data, meta_hash, NULL, FALSE, data_set);
Index: pacemaker-2.1.5+20221208.a3f44794f/include/crm/pengine/internal.h
===================================================================
--- pacemaker-2.1.5+20221208.a3f44794f.orig/include/crm/pengine/internal.h
+++ pacemaker-2.1.5+20221208.a3f44794f/include/crm/pengine/internal.h
@@ -165,6 +165,7 @@ enum pe_warn_once_e {
pe_wo_coloc_inst = (1 << 10),
pe_wo_group_order = (1 << 11),
pe_wo_group_coloc = (1 << 12),
+ pe_wo_instance_defaults = (1 << 20),
};
extern uint32_t pe_wo;