pacemaker  2.0.4-2deceaa3ae
Scalable High-Availability cluster resource manager
Macros | Typedefs | Functions | Variables
pcmk_sched_native.c File Reference
#include <crm_internal.h>
#include <crm/pengine/rules.h>
#include <crm/msg_xml.h>
#include <pacemaker-internal.h>
#include <crm/services.h>
#include <lib/pengine/variant.h>
Include dependency graph for pcmk_sched_native.c:

Go to the source code of this file.

Macros

#define INFINITY_HACK   (INFINITY * -100)
 
#define VARIANT_NATIVE   1
 
#define log_change(a, fmt, args...)
 
#define STOP_SANITY_ASSERT(lineno)
 

Typedefs

typedef gboolean(* rsc_transition_fn) (pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
 

Functions

void ReloadRsc (pe_resource_t *rsc, pe_node_t *node, pe_working_set_t *data_set)
 
gboolean DeleteRsc (pe_resource_t *rsc, pe_node_t *node, gboolean optional, pe_working_set_t *data_set)
 
gboolean StopRsc (pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
 
gboolean StartRsc (pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
 
gboolean DemoteRsc (pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
 
gboolean PromoteRsc (pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
 
gboolean RoleError (pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
 
gboolean NullOp (pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
 
GHashTable * pcmk__native_merge_weights (pe_resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, uint32_t flags)
 
pe_node_tpcmk__native_allocate (pe_resource_t *rsc, pe_node_t *prefer, pe_working_set_t *data_set)
 
void native_create_actions (pe_resource_t *rsc, pe_working_set_t *data_set)
 
void native_internal_constraints (pe_resource_t *rsc, pe_working_set_t *data_set)
 
void native_rsc_colocation_lh (pe_resource_t *rsc_lh, pe_resource_t *rsc_rh, rsc_colocation_t *constraint, pe_working_set_t *data_set)
 
enum filter_colocation_res filter_colocation_constraint (pe_resource_t *rsc_lh, pe_resource_t *rsc_rh, rsc_colocation_t *constraint, gboolean preview)
 
void native_rsc_colocation_rh (pe_resource_t *rsc_lh, pe_resource_t *rsc_rh, rsc_colocation_t *constraint, pe_working_set_t *data_set)
 
void rsc_ticket_constraint (pe_resource_t *rsc_lh, rsc_ticket_t *rsc_ticket, pe_working_set_t *data_set)
 
enum pe_action_flags native_action_flags (pe_action_t *action, pe_node_t *node)
 
enum pe_graph_flags native_update_actions (pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
 
void native_rsc_location (pe_resource_t *rsc, pe__location_t *constraint)
 
void native_expand (pe_resource_t *rsc, pe_working_set_t *data_set)
 
void LogActions (pe_resource_t *rsc, pe_working_set_t *data_set, gboolean terminal)
 
gboolean native_create_probe (pe_resource_t *rsc, pe_node_t *node, pe_action_t *complete, gboolean force, pe_working_set_t *data_set)
 
void rsc_stonith_ordering (pe_resource_t *rsc, pe_action_t *stonith_op, pe_working_set_t *data_set)
 
void native_append_meta (pe_resource_t *rsc, xmlNode *xml)
 

Variables

enum rsc_role_e rsc_state_matrix [RSC_ROLE_MAX][RSC_ROLE_MAX]
 
rsc_transition_fn rsc_action_matrix [RSC_ROLE_MAX][RSC_ROLE_MAX]
 

Macro Definition Documentation

◆ INFINITY_HACK

#define INFINITY_HACK   (INFINITY * -100)

Definition at line 20 of file pcmk_sched_native.c.

◆ log_change

#define log_change (   a,
  fmt,
  args... 
)
Value:
do { \
if(a && a->reason && terminal) { \
printf(" * "fmt" \tdue to %s\n", ##args, a->reason); \
} else if(a && a->reason) { \
crm_notice(fmt" \tdue to %s", ##args, a->reason); \
} else if(terminal) { \
printf(" * "fmt"\n", ##args); \
} else { \
crm_notice(fmt, ##args); \
} \
} while(0)

Definition at line 2350 of file pcmk_sched_native.c.

◆ STOP_SANITY_ASSERT

#define STOP_SANITY_ASSERT (   lineno)
Value:
do { \
if(current && current->details->unclean) { \
/* It will be a pseudo op */ \
} else if(stop == NULL) { \
crm_err("%s:%d: No stop action exists for %s", __FUNCTION__, lineno, rsc->id); \
CRM_ASSERT(stop != NULL); \
} else if(is_set(stop->flags, pe_action_optional)) { \
crm_err("%s:%d: Action %s is still optional", __FUNCTION__, lineno, stop->uuid); \
CRM_ASSERT(is_not_set(stop->flags, pe_action_optional)); \
} \
} while(0)
@ pe_action_optional
Definition: pe_types.h:281

Definition at line 2362 of file pcmk_sched_native.c.

◆ VARIANT_NATIVE

#define VARIANT_NATIVE   1

Definition at line 22 of file pcmk_sched_native.c.

Typedef Documentation

◆ rsc_transition_fn

typedef gboolean(* rsc_transition_fn) (pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)

Definition at line 60 of file pcmk_sched_native.c.

Function Documentation

◆ DeleteRsc()

gboolean DeleteRsc ( pe_resource_t rsc,
pe_node_t node,
gboolean  optional,
pe_working_set_t data_set 
)

Definition at line 2858 of file pcmk_sched_native.c.

◆ DemoteRsc()

gboolean DemoteRsc ( pe_resource_t rsc,
pe_node_t next,
gboolean  optional,
pe_working_set_t data_set 
)

Definition at line 2823 of file pcmk_sched_native.c.

◆ filter_colocation_constraint()

enum filter_colocation_res filter_colocation_constraint ( pe_resource_t rsc_lh,
pe_resource_t rsc_rh,
rsc_colocation_t constraint,
gboolean  preview 
)

Definition at line 1684 of file pcmk_sched_native.c.

◆ LogActions()

void LogActions ( pe_resource_t rsc,
pe_working_set_t data_set,
gboolean  terminal 
)

Definition at line 2482 of file pcmk_sched_native.c.

◆ native_action_flags()

enum pe_action_flags native_action_flags ( pe_action_t action,
pe_node_t node 
)

Definition at line 1939 of file pcmk_sched_native.c.

◆ native_append_meta()

void native_append_meta ( pe_resource_t rsc,
xmlNode *  xml 
)

Definition at line 3438 of file pcmk_sched_native.c.

◆ native_create_actions()

void native_create_actions ( pe_resource_t rsc,
pe_working_set_t data_set 
)

Definition at line 1202 of file pcmk_sched_native.c.

◆ native_create_probe()

gboolean native_create_probe ( pe_resource_t rsc,
pe_node_t node,
pe_action_t complete,
gboolean  force,
pe_working_set_t data_set 
)

Definition at line 2888 of file pcmk_sched_native.c.

◆ native_expand()

void native_expand ( pe_resource_t rsc,
pe_working_set_t data_set 
)

Definition at line 2329 of file pcmk_sched_native.c.

◆ native_internal_constraints()

void native_internal_constraints ( pe_resource_t rsc,
pe_working_set_t data_set 
)

Definition at line 1459 of file pcmk_sched_native.c.

◆ native_rsc_colocation_lh()

void native_rsc_colocation_lh ( pe_resource_t rsc_lh,
pe_resource_t rsc_rh,
rsc_colocation_t constraint,
pe_working_set_t data_set 
)

Definition at line 1684 of file pcmk_sched_native.c.

◆ native_rsc_colocation_rh()

void native_rsc_colocation_rh ( pe_resource_t rsc_lh,
pe_resource_t rsc_rh,
rsc_colocation_t constraint,
pe_working_set_t data_set 
)

Definition at line 1900 of file pcmk_sched_native.c.

◆ native_rsc_location()

void native_rsc_location ( pe_resource_t rsc,
pe__location_t constraint 
)

Definition at line 2263 of file pcmk_sched_native.c.

◆ native_update_actions()

enum pe_graph_flags native_update_actions ( pe_action_t first,
pe_action_t then,
pe_node_t node,
enum pe_action_flags  flags,
enum pe_action_flags  filter,
enum pe_ordering  type,
pe_working_set_t data_set 
)

Definition at line 2052 of file pcmk_sched_native.c.

◆ NullOp()

gboolean NullOp ( pe_resource_t rsc,
pe_node_t next,
gboolean  optional,
pe_working_set_t data_set 
)

Definition at line 2850 of file pcmk_sched_native.c.

◆ pcmk__native_allocate()

pe_node_t* pcmk__native_allocate ( pe_resource_t rsc,
pe_node_t prefer,
pe_working_set_t data_set 
)

Definition at line 497 of file pcmk_sched_native.c.

◆ pcmk__native_merge_weights()

GHashTable* pcmk__native_merge_weights ( pe_resource_t rsc,
const char *  rhs,
GHashTable *  nodes,
const char *  attr,
float  factor,
uint32_t  flags 
)

Definition at line 350 of file pcmk_sched_native.c.

◆ PromoteRsc()

gboolean PromoteRsc ( pe_resource_t rsc,
pe_node_t next,
gboolean  optional,
pe_working_set_t data_set 
)

Definition at line 2782 of file pcmk_sched_native.c.

◆ ReloadRsc()

void ReloadRsc ( pe_resource_t rsc,
pe_node_t node,
pe_working_set_t data_set 
)

Definition at line 3381 of file pcmk_sched_native.c.

◆ RoleError()

gboolean RoleError ( pe_resource_t rsc,
pe_node_t next,
gboolean  optional,
pe_working_set_t data_set 
)

Definition at line 2841 of file pcmk_sched_native.c.

◆ rsc_stonith_ordering()

void rsc_stonith_ordering ( pe_resource_t rsc,
pe_action_t stonith_op,
pe_working_set_t data_set 
)

Definition at line 3360 of file pcmk_sched_native.c.

◆ rsc_ticket_constraint()

void rsc_ticket_constraint ( pe_resource_t rsc_lh,
rsc_ticket_t rsc_ticket,
pe_working_set_t data_set 
)

Definition at line 1939 of file pcmk_sched_native.c.

◆ StartRsc()

gboolean StartRsc ( pe_resource_t rsc,
pe_node_t next,
gboolean  optional,
pe_working_set_t data_set 
)

Definition at line 2763 of file pcmk_sched_native.c.

◆ StopRsc()

gboolean StopRsc ( pe_resource_t rsc,
pe_node_t next,
gboolean  optional,
pe_working_set_t data_set 
)

Definition at line 2679 of file pcmk_sched_native.c.

Variable Documentation

◆ rsc_action_matrix

Initial value:
= {
}
gboolean NullOp(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
gboolean PromoteRsc(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
gboolean RoleError(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
gboolean StartRsc(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
gboolean DemoteRsc(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)
gboolean StopRsc(pe_resource_t *rsc, pe_node_t *next, gboolean optional, pe_working_set_t *data_set)

Definition at line 65 of file pcmk_sched_native.c.

◆ rsc_state_matrix

enum rsc_role_e rsc_state_matrix[RSC_ROLE_MAX][RSC_ROLE_MAX]