diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 13:39:28 +0000 |
commit | 924f5ea83e48277e014ebf0d19a27187cb93e2f7 (patch) | |
tree | 75920a275bba045f6d108204562c218a9a26ea15 /include/crm/cib | |
parent | Adding upstream version 2.1.7. (diff) | |
download | pacemaker-924f5ea83e48277e014ebf0d19a27187cb93e2f7.tar.xz pacemaker-924f5ea83e48277e014ebf0d19a27187cb93e2f7.zip |
Adding upstream version 2.1.8~rc1.upstream/2.1.8_rc1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/crm/cib')
-rw-r--r-- | include/crm/cib/cib_types.h | 58 | ||||
-rw-r--r-- | include/crm/cib/internal.h | 43 | ||||
-rw-r--r-- | include/crm/cib/util.h | 12 | ||||
-rw-r--r-- | include/crm/cib/util_compat.h | 22 |
4 files changed, 83 insertions, 52 deletions
diff --git a/include/crm/cib/cib_types.h b/include/crm/cib/cib_types.h index a803311..281c16e 100644 --- a/include/crm/cib/cib_types.h +++ b/include/crm/cib/cib_types.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2023 the Pacemaker project contributors + * Copyright 2004-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -38,14 +38,21 @@ enum cib_variant { }; enum cib_state { + // NOTE: sbd (as of at least 1.5.2) uses this value cib_connected_command, + + // NOTE: sbd (as of at least 1.5.2) uses this value cib_connected_query, + cib_disconnected }; enum cib_conn_type { cib_command, + + // NOTE: sbd (as of at least 1.5.2) uses this value cib_query, + cib_no_connection, cib_command_nonblocking, }; @@ -78,6 +85,7 @@ enum cib_call_options { * non-legacy mode. */ + // NOTE: sbd (as of at least 1.5.2) uses this value //! \deprecated This value will be removed in a future release cib_scope_local = (1 << 8), @@ -99,7 +107,31 @@ enum cib_call_options { */ cib_transaction = (1 << 10), + /*! + * \brief Treat new attribute values as atomic score updates where possible + * + * This option takes effect when updating XML attributes. For an attribute + * named \c "name", if the new value is \c "name++" or \c "name+=X" for some + * score \c X, the new value is set as follows: + * * If attribute \c "name" is not already set to some value in the element + * being updated, the new value is set as a literal string. + * * If the new value is \c "name++", then the attribute is set to its + * existing value (parsed as a score) plus 1. + * * If the new value is \c "name+=X" for some score \c X, then the + * attribute is set to its existing value plus \c X, where the existing + * value and \c X are parsed and added as scores. + * + * Scores are integer values capped at \c INFINITY and \c -INFINITY. Refer + * to Pacemaker Explained and to the \c char2score() function for more + * details on scores, including how they're parsed and added. + * + * Note: This is implemented only for modify operations. + */ + cib_score_update = (1 << 11), + + // NOTE: sbd (as of at least 1.5.2) uses this value cib_sync_call = (1 << 12), + cib_no_mtime = (1 << 13), #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1) @@ -123,13 +155,16 @@ enum cib_call_options { typedef struct cib_s cib_t; typedef struct cib_api_operations_s { + // NOTE: sbd (as of at least 1.5.2) uses this int (*signon) (cib_t *cib, const char *name, enum cib_conn_type type); //! \deprecated This method will be removed and should not be used int (*signon_raw) (cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd); + // NOTE: sbd (as of at least 1.5.2) uses this int (*signoff) (cib_t *cib); + int (*free) (cib_t *cib); //! \deprecated This method will be removed and should not be used @@ -137,24 +172,32 @@ typedef struct cib_api_operations_s { int callid, int rc, xmlNode *output)); + // NOTE: sbd (as of at least 1.5.2) uses this int (*add_notify_callback) (cib_t *cib, const char *event, void (*callback) (const char *event, xmlNode *msg)); + + // NOTE: sbd (as of at least 1.5.2) uses this int (*del_notify_callback) (cib_t *cib, const char *event, void (*callback) (const char *event, xmlNode *msg)); + // NOTE: sbd (as of at least 1.5.2) uses this int (*set_connection_dnotify) (cib_t *cib, void (*dnotify) (gpointer user_data)); //! \deprecated This method will be removed and should not be used int (*inputfd) (cib_t *cib); + // NOTE: sbd (as of at least 1.5.2) uses this //! \deprecated This method will be removed and should not be used int (*noop) (cib_t *cib, int call_options); int (*ping) (cib_t *cib, xmlNode **output_data, int call_options); + + // NOTE: sbd (as of at least 1.5.2) uses this int (*query) (cib_t *cib, const char *section, xmlNode **output_data, int call_options); + int (*query_from) (cib_t *cib, const char *host, const char *section, xmlNode **output_data, int call_options); @@ -175,6 +218,11 @@ typedef struct cib_api_operations_s { int call_options); int (*upgrade) (cib_t *cib, int call_options); int (*bump_epoch) (cib_t *cib, int call_options); + + /*! + * The \c <failed> element in the reply to a failed creation call is + * deprecated since 2.1.8. + */ int (*create) (cib_t *cib, const char *section, xmlNode *data, int call_options); int (*modify) (cib_t *cib, const char *section, xmlNode *data, @@ -317,17 +365,22 @@ typedef struct cib_api_operations_s { * \brief Set the user as whom all CIB requests via methods will be executed * * By default, the value of the \c CIB_user environment variable is used if - * set. Otherwise, \c root is used. + * set. Otherwise, the current effective user is used. * * \param[in,out] cib CIB connection * \param[in] user Name of user whose permissions to use when * processing requests */ void (*set_user)(cib_t *cib, const char *user); + + int (*fetch_schemas)(cib_t *cib, xmlNode **output_data, const char *after_ver, + int call_options); } cib_api_operations_t; struct cib_s { + // NOTE: sbd (as of at least 1.5.2) uses this enum cib_state state; + enum cib_conn_type type; enum cib_variant variant; @@ -342,6 +395,7 @@ struct cib_s { void (*op_callback) (const xmlNode *msg, int call_id, int rc, xmlNode *output); + // NOTE: sbd (as of at least 1.5.2) uses this cib_api_operations_t *cmds; xmlNode *transaction; diff --git a/include/crm/cib/internal.h b/include/crm/cib/internal.h index 20059ec..d191009 100644 --- a/include/crm/cib/internal.h +++ b/include/crm/cib/internal.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2023 the Pacemaker project contributors + * Copyright 2004-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -32,43 +32,7 @@ #define PCMK__CIB_REQUEST_NOOP "noop" #define PCMK__CIB_REQUEST_SHUTDOWN "cib_shutdown_req" #define PCMK__CIB_REQUEST_COMMIT_TRANSACT "cib_commit_transact" - -# define F_CIB_CLIENTID "cib_clientid" -# define F_CIB_CALLOPTS "cib_callopt" -# define F_CIB_CALLID "cib_callid" -# define F_CIB_CALLDATA "cib_calldata" -# define F_CIB_OPERATION "cib_op" -# define F_CIB_ISREPLY "cib_isreplyto" -# define F_CIB_SECTION "cib_section" -# define F_CIB_HOST "cib_host" -# define F_CIB_RC "cib_rc" -# define F_CIB_UPGRADE_RC "cib_upgrade_rc" -# define F_CIB_DELEGATED "cib_delegated_from" -# define F_CIB_OBJID "cib_object" -# define F_CIB_OBJTYPE "cib_object_type" -# define F_CIB_EXISTING "cib_existing_object" -# define F_CIB_SEENCOUNT "cib_seen" -# define F_CIB_TIMEOUT "cib_timeout" -# define F_CIB_UPDATE "cib_update" -# define F_CIB_GLOBAL_UPDATE "cib_update" -# define F_CIB_UPDATE_RESULT "cib_update_result" -# define F_CIB_CLIENTNAME "cib_clientname" -# define F_CIB_NOTIFY_TYPE "cib_notify_type" -# define F_CIB_NOTIFY_ACTIVATE "cib_notify_activate" -# define F_CIB_UPDATE_DIFF "cib_update_diff" -# define F_CIB_USER "cib_user" -# define F_CIB_LOCAL_NOTIFY_ID "cib_local_notify_id" -# define F_CIB_PING_ID "cib_ping_id" -# define F_CIB_SCHEMA_MAX "cib_schema_max" - -# define T_CIB "cib" -# define T_CIB_COMMAND "cib_command" -# define T_CIB_NOTIFY "cib_notify" -/* notify sub-types */ -# define T_CIB_PRE_NOTIFY "cib_pre_notify" -# define T_CIB_POST_NOTIFY "cib_post_notify" -# define T_CIB_TRANSACTION "cib_transaction" -# define T_CIB_UPDATE_CONFIRM "cib_update_confirmation" +#define PCMK__CIB_REQUEST_SCHEMAS "cib_schemas" /*! * \internal @@ -110,6 +74,7 @@ enum cib__op_type { cib__op_sync_all, cib__op_sync_one, cib__op_upgrade, + cib__op_schemas, }; gboolean cib_diff_version_details(xmlNode * diff, int *admin_epoch, int *epoch, int *updates, @@ -204,7 +169,7 @@ int cib__get_notify_patchset(const xmlNode *msg, const xmlNode **patchset); bool cib__element_in_patchset(const xmlNode *patchset, const char *element); -int cib_perform_op(const char *op, int call_options, cib__op_fn_t fn, +int cib_perform_op(cib_t *cib, const char *op, int call_options, cib__op_fn_t fn, bool is_query, const char *section, xmlNode *req, xmlNode *input, bool manage_counters, bool *config_changed, xmlNode **current_cib, xmlNode **result_cib, xmlNode **diff, diff --git a/include/crm/cib/util.h b/include/crm/cib/util.h index 18726bb..b68c061 100644 --- a/include/crm/cib/util.h +++ b/include/crm/cib/util.h @@ -1,5 +1,5 @@ /* - * Copyright 2004-2022 the Pacemaker project contributors + * Copyright 2004-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -50,15 +50,7 @@ int delete_attr_delegate(cib_t * the_cib, int options, int query_node_uuid(cib_t * the_cib, const char *uname, char **uuid, int *is_remote_node); -int query_node_uname(cib_t * the_cib, const char *uuid, char **uname); - -int set_standby(cib_t * the_cib, const char *uuid, const char *scope, const char *standby_value); - -xmlNode *cib_get_generation(cib_t * cib); - -void cib_metadata(void); -const char *cib_pref(GHashTable * options, const char *name); - +// NOTE: sbd (as of at least 1.5.2) uses this int cib_apply_patch_event(xmlNode *event, xmlNode *input, xmlNode **output, int level); diff --git a/include/crm/cib/util_compat.h b/include/crm/cib/util_compat.h index 20f1e2d..99b2551 100644 --- a/include/crm/cib/util_compat.h +++ b/include/crm/cib/util_compat.h @@ -1,5 +1,5 @@ /* - * Copyright 2021 the Pacemaker project contributors + * Copyright 2021-2024 the Pacemaker project contributors * * The version control history for this file may have further details. * @@ -10,6 +10,10 @@ #ifndef PCMK__CRM_CIB_UTIL_COMPAT__H # define PCMK__CRM_CIB_UTIL_COMPAT__H +#include <libxml/tree.h> // xmlNode + +#include <crm/cib/cib_types.h> // cib_t + #include <crm/common/xml.h> #ifdef __cplusplus extern "C" { @@ -33,6 +37,22 @@ const char *get_object_parent(const char *object_type); //! \deprecated Use pcmk_cib_xpath_for() instead xmlNode *get_object_root(const char *object_type, xmlNode *the_root); +//! \deprecated Do not use +int set_standby(cib_t *the_cib, const char *uuid, const char *scope, + const char *standby_value); + +//! \deprecated Do not use +int query_node_uname(cib_t * the_cib, const char *uuid, char **uname); + +//! \deprecated Do not use +xmlNode *cib_get_generation(cib_t *cib); + +//! \deprecated Do not use +const char *cib_pref(GHashTable * options, const char *name); + +//! \deprecated Do not use +void cib_metadata(void); + #ifdef __cplusplus } #endif |