pacemaker  1.1.18-7fdfbbe
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
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/pengine/rules.h>
Include dependency graph for cib_utils.c:

Go to the source code of this file.

Macros

#define XPATH_CONFIG_CHANGE
 

Functions

int cib_compare_generation (xmlNode *left, xmlNode *right)
 
xmlNode * get_cib_copy (cib_t *cib)
 
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)
 
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)
 
xmlNode * createEmptyCib (int admin_epoch)
 
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 *token, 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)
 
void verify_cib_options (GHashTable *options)
 
const char * cib_pref (GHashTable *options, const char *name)
 
gboolean cib_read_config (GHashTable *options, xmlNode *current_cib)
 
int cib_apply_patch_event (xmlNode *event, xmlNode *input, xmlNode **output, int level)
 
gboolean cib_internal_config_changed (xmlNode *diff)
 
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)
 

Variables

struct config_root_s known_paths []
 
pe_cluster_option cib_opts []
 

Macro Definition Documentation

#define XPATH_CONFIG_CHANGE
Value:
"//" XML_DIFF_CHANGE "[contains(@" XML_DIFF_PATH ",'/" XML_CIB_TAG_CRMCONFIG "/')]"
#define XML_DIFF_CHANGE
Definition: msg_xml.h:433
#define XML_DIFF_PATH
Definition: msg_xml.h:438
#define XML_CIB_TAG_CRMCONFIG
Definition: msg_xml.h:163

Definition at line 814 of file cib_utils.c.

Function Documentation

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

Definition at line 773 of file cib_utils.c.

int cib_compare_generation ( xmlNode *  left,
xmlNode *  right 
)

Definition at line 66 of file cib_utils.c.

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

Definition at line 588 of file cib_utils.c.

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

Definition at line 177 of file cib_utils.c.

xmlNode* cib_get_generation ( cib_t cib)

Definition at line 144 of file cib_utils.c.

gboolean cib_internal_config_changed ( xmlNode *  diff)

Definition at line 819 of file cib_utils.c.

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 835 of file cib_utils.c.

void cib_metadata ( void  )

Definition at line 725 of file cib_utils.c.

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

Definition at line 623 of file cib_utils.c.

void cib_native_notify ( gpointer  data,
gpointer  user_data 
)

Definition at line 670 of file cib_utils.c.

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 291 of file cib_utils.c.

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

Definition at line 740 of file cib_utils.c.

gboolean cib_read_config ( GHashTable *  options,
xmlNode *  current_cib 
)

Definition at line 746 of file cib_utils.c.

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

Definition at line 159 of file cib_utils.c.

xmlNode* createEmptyCib ( int  admin_epoch)

Definition at line 246 of file cib_utils.c.

xmlNode* get_cib_copy ( cib_t cib)

Definition at line 111 of file cib_utils.c.

const char* get_object_parent ( const char *  object_type)

Definition at line 216 of file cib_utils.c.

const char* get_object_path ( const char *  object_type)

Definition at line 201 of file cib_utils.c.

xmlNode* get_object_root ( const char *  object_type,
xmlNode *  the_root 
)

Definition at line 230 of file cib_utils.c.

void verify_cib_options ( GHashTable *  options)

Definition at line 734 of file cib_utils.c.

Variable Documentation

pe_cluster_option cib_opts[]
Initial value:
= {
{
"enable-acl", NULL,
"boolean", NULL, "false", &check_boolean,
"Enable CIB ACL",
NULL
},
{
"cluster-ipc-limit", NULL,
"integer", NULL, "500", &check_positive_number,
"Maximum IPC message backlog before disconnecting a cluster daemon",
"Raise this if log has \"Evicting client\" messages for cluster daemon"
" PIDs (a good value is the number of resources in the cluster"
" multiplied by the number of nodes)"
},
}
gboolean check_positive_number(const char *value)
Definition: utils.c:161
gboolean check_boolean(const char *value)
Definition: utils.c:129

Definition at line 701 of file cib_utils.c.

struct config_root_s known_paths[]
Initial value:
= {
{ NULL, NULL, "//cib" },
{ XML_TAG_CIB, NULL, "//cib" },
{ XML_CIB_TAG_STATUS, "/cib", "//cib/status" },
{ XML_CIB_TAG_CONFIGURATION,"/cib", "//cib/configuration" },
{ XML_CIB_TAG_CRMCONFIG, "/cib/configuration", "//cib/configuration/crm_config" },
{ XML_CIB_TAG_NODES, "/cib/configuration", "//cib/configuration/nodes" },
{ XML_CIB_TAG_DOMAINS, "/cib/configuration", "//cib/configuration/domains" },
{ XML_CIB_TAG_RESOURCES, "/cib/configuration", "//cib/configuration/resources" },
{ XML_CIB_TAG_CONSTRAINTS, "/cib/configuration", "//cib/configuration/constraints" },
{ XML_CIB_TAG_OPCONFIG, "/cib/configuration", "//cib/configuration/op_defaults" },
{ XML_CIB_TAG_RSCCONFIG, "/cib/configuration", "//cib/configuration/rsc_defaults" },
{ XML_CIB_TAG_ACLS, "/cib/configuration", "//cib/configuration/acls" },
{ XML_TAG_FENCING_TOPOLOGY, "/cib/configuration", "//cib/configuration/fencing-topology" },
{ XML_CIB_TAG_SECTION_ALL, NULL, "//cib" },
}
#define XML_CIB_TAG_SECTION_ALL
Definition: msg_xml.h:156
#define XML_CIB_TAG_DOMAINS
Definition: msg_xml.h:161
#define XML_CIB_TAG_CONSTRAINTS
Definition: msg_xml.h:162
#define XML_TAG_FENCING_TOPOLOGY
Definition: msg_xml.h:420
#define XML_CIB_TAG_NODES
Definition: msg_xml.h:160
#define XML_CIB_TAG_RESOURCES
Definition: msg_xml.h:159
#define XML_CIB_TAG_ACLS
Definition: msg_xml.h:166
#define XML_TAG_CIB
Definition: msg_xml.h:81
#define XML_CIB_TAG_CRMCONFIG
Definition: msg_xml.h:163
#define XML_CIB_TAG_RSCCONFIG
Definition: msg_xml.h:165
#define XML_CIB_TAG_STATUS
Definition: msg_xml.h:158
#define XML_CIB_TAG_CONFIGURATION
Definition: msg_xml.h:157
#define XML_CIB_TAG_OPCONFIG
Definition: msg_xml.h:164

Definition at line 47 of file cib_utils.c.