 |
pacemaker
2.0.3-4b1f869f0f
Scalable High-Availability cluster resource manager
|
Go to the documentation of this file.
36 struct dirent **namelist;
39 #if _POSIX_C_SOURCE < 200809L && !(defined(O_SEARCH) || defined(O_PATH))
40 char buffer[FILENAME_MAX + 1];
41 #elif defined(O_SEARCH)
47 for (i = 0; i < file_num; i++) {
51 #if _POSIX_C_SOURCE < 200809L && !(defined(O_SEARCH) || defined(O_PATH))
54 if (stat(buffer, &prop) == 0 && S_ISREG(prop.st_mode)) {
67 if (fstatat(dirfd, namelist[i]->d_name, &prop, 0) == 0
68 && S_ISREG(prop.st_mode)) {
80 #if _POSIX_C_SOURCE >= 200809L || defined(O_SEARCH) || defined(O_PATH)
102 xmlNode *actions = NULL;
103 xmlXPathObject *xpathObj = NULL;
109 crm_warn(
"Could not execute metadata action for %s: %s "
124 if (buffer == NULL) {
125 crm_warn(
"Metadata action for %s returned no data", agent);
133 crm_warn(
"Metadata for %s is invalid", agent);
138 if (numXpathResults(xpathObj) > 0) {
145 if (numXpathResults(xpathObj) <= 0) {
159 xpathObj =
xpath_search(xml,
"//parameter[@name='port']");
160 if (numXpathResults(xpathObj) > 0) {
169 if (buffer == NULL) {
185 int rc = stat(buffer, &prop);
188 return (rc >= 0) && S_ISREG(prop.st_mode);
193 const char *agent, GHashTable *params,
int timeout,
194 char **output,
char **error_output)
198 target, 0, timeout, params,
#define CRM_DEFAULT_OP_TIMEOUT_S
int stonith__execute(stonith_action_t *action)
stonith_key_value_t * stonith_key_value_add(stonith_key_value_t *kvp, const char *key, const char *value)
int alphasort(const void *dirent1, const void *dirent2)
int stonith__rhcs_metadata(const char *agent, int timeout, char **output)
Execute RHCS-compatible agent's meta-data action.
void stonith__action_result(stonith_action_t *action, int *rc, char **output, char **error_output)
xmlNode * create_xml_node(xmlNode *parent, const char *name)
#define pcmk_err_schema_validation
const char * pcmk_strerror(int rc)
#define crm_notice(fmt, args...)
#define crm_warn(fmt, args...)
void free_xml(xmlNode *child)
xmlXPathObjectPtr xpath_search(xmlNode *xml_top, const char *path)
int stonith__list_rhcs_agents(stonith_key_value_t **devices)
#define RH_STONITH_PREFIX
int stonith__rhcs_validate(stonith_t *st, int call_options, const char *target, const char *agent, GHashTable *params, int timeout, char **output, char **error_output)
char * crm_strdup_printf(char const *format,...) __attribute__((__format__(__printf__
void stonith__destroy_action(stonith_action_t *action)
xmlNode * string2xml(const char *input)
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
stonith_action_t * stonith_action_create(const char *agent, const char *_action, const char *victim, uint32_t victim_nodeid, int timeout, GHashTable *device_args, GHashTable *port_map)
xmlNode * getXpathResult(xmlXPathObjectPtr xpathObj, int index)
char * dump_xml_formatted_with_text(xmlNode *msg)
bool stonith__agent_is_rhcs(const char *agent)
bool crm_starts_with(const char *str, const char *prefix)
Check whether a string starts with a certain sequence.
struct stonith_action_s stonith_action_t
void freeXpathObject(xmlXPathObjectPtr xpathObj)