12 #include <sys/param.h>
38 if (data_set != NULL) {
52 if (data_set != NULL) {
54 data_set->
priv = NULL;
86 if (data_set->
input == NULL) {
90 if (data_set->
now == NULL) {
94 if (data_set->
dc_uuid == NULL) {
112 if (!pcmk_any_flags_set(data_set->
flags,
115 crm_warn(
"Fencing and resource management disabled due to lack of quorum");
132 for (GList *item = data_set->
resources; item != NULL;
154 pe_free_resources(GList *resources)
157 GList *iterator = resources;
159 while (iterator != NULL) {
161 iterator = iterator->next;
164 if (resources != NULL) {
165 g_list_free(resources);
170 pe_free_actions(GList *actions)
172 GList *iterator = actions;
174 while (iterator != NULL) {
176 iterator = iterator->next;
178 if (actions != NULL) {
179 g_list_free(actions);
184 pe_free_nodes(GList *nodes)
186 for (GList *iterator = nodes; iterator != NULL; iterator = iterator->next) {
224 pe__free_ordering(GList *constraints)
226 GList *iterator = constraints;
228 while (iterator != NULL) {
231 iterator = iterator->next;
237 if (constraints != NULL) {
238 g_list_free(constraints);
243 pe__free_location(GList *constraints)
245 GList *iterator = constraints;
247 while (iterator != NULL) {
250 iterator = iterator->next;
256 if (constraints != NULL) {
257 g_list_free(constraints);
272 if (data_set == NULL) {
286 g_hash_table_destroy(data_set->
tickets);
293 if (data_set->
tags) {
294 g_hash_table_destroy(data_set->
tags);
303 pe_free_actions(data_set->
actions);
306 pe_free_nodes(data_set->
nodes);
331 if (data_set == NULL) {
335 crm_trace(
"Deleting %d ordering constraints",
340 crm_trace(
"Deleting %d location constraints",
345 crm_trace(
"Deleting %d colocation constraints",
350 crm_trace(
"Deleting %d ticket constraints",
361 void *priv = data_set->
priv;
365 data_set->
priv = priv;
370 data_set->
flags = 0x0ULL;
392 for (rIter = rsc_list;
id && rIter; rIter = rIter->next) {
413 crm_trace(
"Looking up %s via its uname instead", uname);
420 GList *gIter = nodes;
422 for (; gIter != NULL; gIter = gIter->next) {
436 GList *gIter = nodes;
438 for (; gIter != NULL; gIter = gIter->next) {
#define CRM_CHECK(expr, failure_action)
pe_node_t * pe_find_node(GList *node_list, const char *uname)
enum pe_quorum_policy no_quorum_policy
pe_node_t * pe_find_node_any(GList *node_list, const char *id, const char *uname)
#define pe_flag_stop_action_orphans
pe_resource_t * pe_find_resource_with_flags(GList *rsc_list, const char *id, enum pe_find flags)
bool pe__is_guest_or_remote_node(const pe_node_t *node)
G_GNUC_INTERNAL gboolean unpack_remote_nodes(xmlNode *xml_resources, pe_working_set_t *data_set)
#define pe_flag_concurrent_fencing
void pe_free_working_set(pe_working_set_t *data_set)
Free a working set.
#define pe_flag_symmetric_cluster
pe_working_set_t * pe_new_working_set(void)
Create a new working set.
resource_object_functions_t * fns
G_GNUC_INTERNAL gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set)
#define pe_flag_no_counts
Don't count total, disabled and blocked resource instances.
#define pe_flag_have_status
pe_resource_t * pe_find_resource(GList *rsc_list, const char *id_rh)
int order_id
Deprecated (will be removed in a future release)
#define XML_CIB_TAG_NODES
#define pe_flag_have_quorum
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
#define PCMK__CONCURRENT_FENCING_DEFAULT
#define XML_CIB_TAG_RESOURCES
G_GNUC_INTERNAL gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set)
GList * ticket_constraints
void pe_reset_working_set(pe_working_set_t *data_set)
Reset a working set to default state without freeing it.
#define crm_warn(fmt, args...)
void cleanup_calculations(pe_working_set_t *data_set)
Reset working set to default state without freeing it or constraints.
pe_find
Determine behavior of pe_find_resource_with_flags()
G_GNUC_INTERNAL gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set)
char * crm_element_value_copy(const xmlNode *data, const char *name)
Retrieve a copy of the value of an XML attribute.
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
pe_resource_t *(* find_rsc)(pe_resource_t *parent, const char *search, const pe_node_t *node, int flags)
#define crm_trace(fmt, args...)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
void set_working_set_defaults(pe_working_set_t *data_set)
struct pe_node_shared_s * details
G_GNUC_INTERNAL gboolean unpack_resources(xmlNode *xml_resources, pe_working_set_t *data_set)
#define XML_ATTR_HAVE_QUORUM
Wrappers for and extensions to libxml2.
xmlNode * create_xml_node(xmlNode *parent, const char *name)
void free_xml(xmlNode *child)
void pe__free_param_checks(pe_working_set_t *data_set)
pe_node_t * pe_find_node_id(GList *node_list, const char *id)
match resource ID or LRM history ID
#define pe_flag_quick_location
GList * ordering_constraints
gboolean cluster_status(pe_working_set_t *data_set)
crm_time_t * crm_time_new(const char *string)
#define XML_CIB_TAG_CRMCONFIG
#define XML_CIB_TAG_RSCCONFIG
GList * colocation_constraints
void(* free)(pe_resource_t *)
#define pe__set_working_set_flags(working_set, flags_to_set)
GHashTable * digest_cache
cache of calculated resource digests
GList * placement_constraints
#define XML_CIB_TAG_STATUS
gboolean crm_is_true(const char *s)
G_GNUC_INTERNAL gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set)
#define XML_CIB_TAG_OPCONFIG
#define pe__clear_working_set_flags(working_set, flags_to_clear)
GHashTable * template_rsc_sets
void pe_free_action(pe_action_t *action)
void crm_time_free(crm_time_t *dt)
#define pe_flag_stop_rsc_orphans