Skip to content

Commit

Permalink
Merge pull request #3762 from kgaillot/rules
Browse files Browse the repository at this point in the history
Deprecate libpe_rules
  • Loading branch information
kgaillot authored Dec 17, 2024
2 parents c236bb3 + ff2debd commit bc2911e
Show file tree
Hide file tree
Showing 20 changed files with 357 additions and 390 deletions.
17 changes: 12 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,24 @@ AC_ARG_ENABLE([hardening],
yes_no_try "$enable_hardening" "try"
enable_hardening=$?

dnl --enable-* options: features
dnl --enable-* options: features within Pacemaker

dnl @COMPAT This should be --with-systemd
AC_ARG_ENABLE([systemd],
[AS_HELP_STRING([--enable-systemd],
[enable support for managing resources via systemd @<:@try@:>@])]
)
yes_no_try "$enable_systemd" "try"
enable_systemd=$?

dnl --enable-* options: features inherent to Pacemaker
AC_ARG_ENABLE([deprecated-libs],
[AS_HELP_STRING([--enable-deprecated-libs],
[Build and install deprecated C libraries @<:@yes@:>@])]
)
yes_no_try "$enable_deprecated_libs" "yes"
enable_deprecated_libs=$?
AM_CONDITIONAL([BUILD_DEPRECATED_LIBS],
[test $enable_deprecated_libs -ne $DISABLED])

# AM_GNU_GETTEXT calls AM_NLS which defines the nls option, but it defaults
# to enabled. We override the definition of AM_NLS to flip the default and mark
Expand All @@ -255,7 +263,7 @@ AC_DEFUN([AM_NLS],
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18])

dnl --with-* options: external software support, and custom locations
dnl --with-* options: external software support, and custom values

dnl This argument is defined via an M4 macro so default can be a variable
AC_DEFUN([VERSION_ARG],
Expand Down Expand Up @@ -295,8 +303,7 @@ AC_ARG_WITH([bug-url],
AS_IF([test x"${BUG_URL}" = x""],
[BUG_URL="https://bugs.clusterlabs.org/enter_bug.cgi?product=Pacemaker"])

dnl --with-* options: features

dnl @COMPAT This should be --enable-cibsecrets option
AC_ARG_WITH([cibsecrets],
[AS_HELP_STRING([--with-cibsecrets],
[support separate file for CIB secrets @<:@no@:>@])]
Expand Down
1 change: 0 additions & 1 deletion daemons/attrd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pacemaker_attrd_LDFLAGS = $(LDFLAGS_HARDENED_EXE)

pacemaker_attrd_LDADD = $(top_builddir)/lib/cluster/libcrmcluster.la
pacemaker_attrd_LDADD += $(top_builddir)/lib/cib/libcib.la
pacemaker_attrd_LDADD += $(top_builddir)/lib/pengine/libpe_rules.la
pacemaker_attrd_LDADD += $(top_builddir)/lib/lrmd/liblrmd.la
pacemaker_attrd_LDADD += $(top_builddir)/lib/common/libcrmcommon.la
pacemaker_attrd_LDADD += $(CLUSTERLIBS)
Expand Down
5 changes: 2 additions & 3 deletions daemons/attrd/attrd_alerts.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <crm/common/alerts_internal.h>
#include <crm/common/cib_internal.h>
#include <crm/common/xml.h>
#include <crm/pengine/rules_internal.h>
#include <crm/lrmd_internal.h>
#include "pacemaker-attrd.h"

Expand Down Expand Up @@ -101,8 +100,8 @@ config_query_callback(xmlNode * msg, int call_id, int rc, xmlNode * output, void
return;
}

pe_free_alert_list(attrd_alert_list);
attrd_alert_list = pe_unpack_alerts(crmalerts);
pcmk__free_alerts(attrd_alert_list);
attrd_alert_list = pcmk__unpack_alerts(crmalerts);
}

gboolean
Expand Down
1 change: 0 additions & 1 deletion daemons/controld/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pacemaker_controld_LDFLAGS = $(LDFLAGS_HARDENED_EXE)

pacemaker_controld_LDADD = $(top_builddir)/lib/pacemaker/libpacemaker.la
pacemaker_controld_LDADD += $(top_builddir)/lib/cib/libcib.la
pacemaker_controld_LDADD += $(top_builddir)/lib/pengine/libpe_rules.la
pacemaker_controld_LDADD += $(top_builddir)/lib/fencing/libstonithd.la
pacemaker_controld_LDADD += $(top_builddir)/lib/cluster/libcrmcluster.la
pacemaker_controld_LDADD += $(top_builddir)/lib/lrmd/liblrmd.la
Expand Down
6 changes: 3 additions & 3 deletions daemons/controld/controld_alerts.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include <glib.h>
#include <libxml/tree.h>

#include <crm/common/alerts_internal.h>
#include <crm/fencing/internal.h>
#include <crm/lrmd.h>
#include <crm/lrmd_internal.h>
#include <crm/pengine/rules_internal.h>
#include <crm/pengine/status.h>
#include <crm/stonith-ng.h>

Expand All @@ -26,8 +26,8 @@ static GList *crmd_alert_list = NULL;
void
crmd_unpack_alerts(xmlNode *alerts)
{
pe_free_alert_list(crmd_alert_list);
crmd_alert_list = pe_unpack_alerts(alerts);
pcmk__free_alerts(crmd_alert_list);
crmd_alert_list = pcmk__unpack_alerts(alerts);
}

void
Expand Down
1 change: 0 additions & 1 deletion daemons/controld/controld_execd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <crm/crm.h>
#include <crm/common/iso8601.h>
#include <crm/common/xml.h>
#include <crm/pengine/rules_internal.h>
#include <crm/lrmd_internal.h>

#include <pacemaker-internal.h>
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/Pacemaker_Development/c.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ Pacemaker Libraries
| | | | | single: C library; libpe_rules |
| | | | | single: libpe_rules |
| | | | | |
| | | | | Scheduler functionality related |
| | | | | to evaluating rules |
| | | | | Deprecated APIs related to |
| | | | | evaluating rules |
+---------------+---------+---------------+---------------------------+-------------------------------------+
| libpe_status | pe | lib/pengine | | include/crm/pengine/* | .. index:: |
| | | | | single: C library; libpe_status |
Expand Down
6 changes: 3 additions & 3 deletions doc/sphinx/Pacemaker_Development/components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,17 @@ queryable by the `stonith_api_operations_t:history()` method. `crm_mon` and
.. index::
single: scheduler
single: pacemaker-schedulerd
single: libcrmcommon
single: libpe_status
single: libpe_rules
single: libpacemaker

Scheduler
#########

``pacemaker-schedulerd`` is the Pacemaker daemon that runs the Pacemaker
scheduler for the controller, but "the scheduler" in general refers to related
library code in ``libpe_status`` and ``libpe_rules`` (``lib/pengine/*.c``), and
some of ``libpacemaker`` (``lib/pacemaker/pcmk_sched_*.c``).
library code in various files in ``libcrmcommon``, ``libpe_status``, and
``libpacemaker``.

The purpose of the scheduler is to take a CIB as input and generate a
transition graph (list of actions that need to be taken) as output.
Expand Down
8 changes: 6 additions & 2 deletions include/crm/common/alerts_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
#ifndef PCMK__CRM_COMMON_ALERTS_INTERNAL__H
#define PCMK__CRM_COMMON_ALERTS_INTERNAL__H

#include <glib.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdint.h> // uint32_t

#include <glib.h> // GList, GHashTable
#include <libxml/tree.h> // xmlNode

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -81,6 +83,8 @@ void pcmk__add_alert_key(GHashTable *table, enum pcmk__alert_keys_e name,
const char *value);
void pcmk__add_alert_key_int(GHashTable *table, enum pcmk__alert_keys_e name,
int value);
GList *pcmk__unpack_alerts(const xmlNode *alerts);
void pcmk__free_alerts(GList *alert_list);

static inline const char *
pcmk__alert_flag2text(enum pcmk__alert_flags flag)
Expand Down
29 changes: 0 additions & 29 deletions include/crm/pengine/rules_internal.h

This file was deleted.

5 changes: 4 additions & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ LIBS = cib \
pkgconfig_DATA = $(LIBS:%=pacemaker-%.pc) \
libpacemaker.pc \
pacemaker.pc \
pacemaker-pe_rules.pc \
pacemaker-pe_status.pc

if BUILD_DEPRECATED_LIBS
pkgconfig_DATA += pacemaker-pe_rules.pc
endif

EXTRA_DIST = $(pkgconfig_DATA:%=%.in)

SUBDIRS = common \
Expand Down
Loading

0 comments on commit bc2911e

Please sign in to comment.