pacemaker  2.1.2-ada5c3b36
Scalable High-Availability cluster resource manager
Macros | Typedefs | Functions | Variables
pcmk_sched_native.c File Reference
#include <crm_internal.h>
#include <stdbool.h>
#include <crm/pengine/rules.h>
#include <crm/msg_xml.h>
#include <crm/common/xml_internal.h>
#include <pacemaker-internal.h>
#include <crm/services.h>
#include "libpacemaker_private.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 clear_node_weights_flags(nw_flags, nw_rsc, flags_to_clear)
 
#define clear_action_flag_because(action, flag, reason)
 
#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 *primary_id, 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 *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
 
void native_rsc_colocation_rh (pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, 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 native_create_probe (pe_resource_t *rsc, pe_node_t *node, pe_action_t *complete, gboolean force, pe_working_set_t *data_set)
 
void native_append_meta (pe_resource_t *rsc, xmlNode *xml)
 

Variables

bool pcmk__is_daemon
 

Macro Definition Documentation

◆ clear_action_flag_because

#define clear_action_flag_because (   action,
  flag,
  reason 
)
Value:
do { \
if (pcmk_is_set((action)->flags, (flag))) { \
pe__clear_action_flags(action, flag); \
if ((action)->rsc != (reason)->rsc) { \
char *reason_text = pe__action2reason((reason), (flag)); \
pe_action_set_reason((action), reason_text, \
free(reason_text); \
} \
} \
} while (0)
char * pe__action2reason(pe_action_t *action, enum pe_action_flags flag)
Definition: utils.c:2324
const char * action
Definition: pcmk_fence.c:30
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition: util.h:114
uint64_t flags
Definition: remote.c:149

Definition at line 1768 of file pcmk_sched_native.c.

◆ clear_node_weights_flags

#define clear_node_weights_flags (   nw_flags,
  nw_rsc,
  flags_to_clear 
)
Value:
do { \
flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \
"Node weight", (nw_rsc)->id, (flags), \
(flags_to_clear), #flags_to_clear); \
} while (0)
#define LOG_TRACE
Definition: logging.h:36
uint64_t flags
Definition: remote.c:149

Definition at line 82 of file pcmk_sched_native.c.

◆ INFINITY_HACK

#define INFINITY_HACK   (INFINITY * -100)

Definition at line 25 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", \
__func__, lineno, rsc->id); \
CRM_ASSERT(stop != NULL); \
} else if (pcmk_is_set(stop->flags, pe_action_optional)) { \
crm_err("%s:%d: Action %s is still optional", \
__func__, lineno, stop->uuid); \
CRM_ASSERT(!pcmk_is_set(stop->flags, pe_action_optional)); \
} \
} while(0)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
Definition: util.h:114

Definition at line 2018 of file pcmk_sched_native.c.

◆ VARIANT_NATIVE

#define VARIANT_NATIVE   1

Definition at line 27 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 67 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 2219 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 2184 of file pcmk_sched_native.c.

◆ LogActions()

void LogActions ( pe_resource_t rsc,
pe_working_set_t data_set 
)

Definition at line 2033 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 1749 of file pcmk_sched_native.c.

◆ native_append_meta()

void native_append_meta ( pe_resource_t rsc,
xmlNode *  xml 
)

Definition at line 2538 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 1195 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 2251 of file pcmk_sched_native.c.

◆ native_expand()

void native_expand ( pe_resource_t rsc,
pe_working_set_t data_set 
)

Definition at line 1997 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 1470 of file pcmk_sched_native.c.

◆ native_rsc_colocation_lh()

void native_rsc_colocation_lh ( pe_resource_t dependent,
pe_resource_t primary,
pcmk__colocation_t constraint,
pe_working_set_t data_set 
)

Definition at line 1700 of file pcmk_sched_native.c.

◆ native_rsc_colocation_rh()

void native_rsc_colocation_rh ( pe_resource_t dependent,
pe_resource_t primary,
pcmk__colocation_t constraint,
pe_working_set_t data_set 
)

Definition at line 1721 of file pcmk_sched_native.c.

◆ native_rsc_location()

void native_rsc_location ( pe_resource_t rsc,
pe__location_t constraint 
)

Definition at line 1991 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 1848 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 2211 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 494 of file pcmk_sched_native.c.

◆ pcmk__native_merge_weights()

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

Definition at line 363 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 2143 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 2479 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 2202 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 2124 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 2073 of file pcmk_sched_native.c.

Variable Documentation

◆ pcmk__is_daemon

bool pcmk__is_daemon

Definition at line 47 of file logging.c.