pacemaker  2.1.6-802a72226b
Scalable High-Availability cluster resource manager
Macros | Functions
cib_utils.c File Reference
#include <crm_internal.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <sys/utsname.h>
#include <glib.h>
#include <crm/crm.h>
#include <crm/cib/internal.h>
#include <crm/msg_xml.h>
#include <crm/common/xml.h>
#include <crm/common/xml_internal.h>
#include <crm/pengine/rules.h>
#include <crm/cib/util_compat.h>
Include dependency graph for cib_utils.c:

Go to the source code of this file.

Macros

#define log_signon_query_err(out, fmt, args...)
 

Functions

xmlNode * cib_get_generation (cib_t *cib)
 
gboolean cib_version_details (xmlNode *cib, int *admin_epoch, int *epoch, int *updates)
 
gboolean cib_diff_version_details (xmlNode *diff, int *admin_epoch, int *epoch, int *updates, int *_admin_epoch, int *_epoch, int *_updates)
 
xmlNode * createEmptyCib (int cib_epoch)
 Create XML for a new (empty) CIB. More...
 
int cib_perform_op (const char *op, int call_options, cib_op_t *fn, gboolean is_query, const char *section, xmlNode *req, xmlNode *input, gboolean manage_counters, gboolean *config_changed, xmlNode *current_cib, xmlNode **result_cib, xmlNode **diff, xmlNode **output)
 
xmlNode * cib_create_op (int call_id, const char *op, const char *host, const char *section, xmlNode *data, int call_options, const char *user_name)
 
void cib_native_callback (cib_t *cib, xmlNode *msg, int call_id, int rc)
 
void cib_native_notify (gpointer data, gpointer user_data)
 
void cib_metadata (void)
 
const char * cib_pref (GHashTable *options, const char *name)
 
gboolean cib_read_config (GHashTable *options, xmlNode *current_cib)
 
int cib_internal_op (cib_t *cib, const char *op, const char *host, const char *section, xmlNode *data, xmlNode **output_data, int call_options, const char *user_name)
 
int cib_apply_patch_event (xmlNode *event, xmlNode *input, xmlNode **output, int level)
 Apply a CIB update patch to a given CIB. More...
 
int cib__signon_query (pcmk__output_t *out, cib_t **cib, xmlNode **cib_object)
 
int cib__clean_up_connection (cib_t **cib)
 
const char * get_object_path (const char *object_type)
 
const char * get_object_parent (const char *object_type)
 
xmlNode * get_object_root (const char *object_type, xmlNode *the_root)
 

Macro Definition Documentation

◆ log_signon_query_err

#define log_signon_query_err (   out,
  fmt,
  args... 
)
Value:
do { \
if (out != NULL) { \
out->err(out, fmt, ##args); \
} else { \
crm_err(fmt, ##args); \
} \
} while (0)

Definition at line 736 of file cib_utils.c.

Function Documentation

◆ cib__clean_up_connection()

int cib__clean_up_connection ( cib_t **  cib)

Definition at line 799 of file cib_utils.c.

◆ cib__signon_query()

int cib__signon_query ( pcmk__output_t out,
cib_t **  cib,
xmlNode **  cib_object 
)

Definition at line 745 of file cib_utils.c.

◆ cib_apply_patch_event()

int cib_apply_patch_event ( xmlNode *  event,
xmlNode *  input,
xmlNode **  output,
int  level 
)

Apply a CIB update patch to a given CIB.

Parameters
[in]eventCIB update patch
[in]inputCIB to patch
[out]outputResulting CIB after patch
[in]levelLog the patch at this log level (unless LOG_CRIT)
Returns
Legacy Pacemaker return code
Note
sbd calls this function

Definition at line 685 of file cib_utils.c.

◆ cib_create_op()

xmlNode* cib_create_op ( int  call_id,
const char *  op,
const char *  host,
const char *  section,
xmlNode *  data,
int  call_options,
const char *  user_name 
)

Definition at line 468 of file cib_utils.c.

◆ cib_diff_version_details()

gboolean cib_diff_version_details ( xmlNode *  diff,
int *  admin_epoch,
int *  epoch,
int *  updates,
int *  _admin_epoch,
int *  _epoch,
int *  _updates 
)

Definition at line 61 of file cib_utils.c.

◆ cib_get_generation()

xmlNode* cib_get_generation ( cib_t cib)

Definition at line 28 of file cib_utils.c.

◆ cib_internal_op()

int cib_internal_op ( cib_t cib,
const char *  op,
const char *  host,
const char *  section,
xmlNode *  data,
xmlNode **  output_data,
int  call_options,
const char *  user_name 
)

Definition at line 657 of file cib_utils.c.

◆ cib_metadata()

void cib_metadata ( void  )

Definition at line 603 of file cib_utils.c.

◆ cib_native_callback()

void cib_native_callback ( cib_t cib,
xmlNode *  msg,
int  call_id,
int  rc 
)

Definition at line 500 of file cib_utils.c.

◆ cib_native_notify()

void cib_native_notify ( gpointer  data,
gpointer  user_data 
)

Definition at line 549 of file cib_utils.c.

◆ cib_perform_op()

int cib_perform_op ( const char *  op,
int  call_options,
cib_op_t fn,
gboolean  is_query,
const char *  section,
xmlNode *  req,
xmlNode *  input,
gboolean  manage_counters,
gboolean *  config_changed,
xmlNode *  current_cib,
xmlNode **  result_cib,
xmlNode **  diff,
xmlNode **  output 
)

Definition at line 145 of file cib_utils.c.

◆ cib_pref()

const char* cib_pref ( GHashTable *  options,
const char *  name 
)

Definition at line 623 of file cib_utils.c.

◆ cib_read_config()

gboolean cib_read_config ( GHashTable *  options,
xmlNode *  current_cib 
)

Definition at line 630 of file cib_utils.c.

◆ cib_version_details()

gboolean cib_version_details ( xmlNode *  cib,
int *  admin_epoch,
int *  epoch,
int *  updates 
)

Definition at line 43 of file cib_utils.c.

◆ createEmptyCib()

xmlNode* createEmptyCib ( int  cib_epoch)

Create XML for a new (empty) CIB.

Parameters
[in]cib_epochWhat to use as "epoch" CIB property
Returns
Newly created XML for empty CIB
Note
It is the caller's responsibility to free the result with free_xml().

Definition at line 89 of file cib_utils.c.

◆ get_object_parent()

const char* get_object_parent ( const char *  object_type)
Deprecated:
Use pcmk_cib_parent_name_for() instead

Definition at line 825 of file cib_utils.c.

◆ get_object_path()

const char* get_object_path ( const char *  object_type)
Deprecated:
Use pcmk_cib_xpath_for() instead

Definition at line 819 of file cib_utils.c.

◆ get_object_root()

xmlNode* get_object_root ( const char *  object_type,
xmlNode *  the_root 
)
Deprecated:
Use pcmk_cib_xpath_for() instead

Definition at line 831 of file cib_utils.c.