pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
Macros | Typedefs | Enumerations | Functions
bundle.c File Reference
#include <crm_internal.h>
#include <ctype.h>
#include <stdint.h>
#include <crm/pengine/rules.h>
#include <crm/pengine/status.h>
#include <crm/pengine/internal.h>
#include <crm/msg_xml.h>
#include <crm/common/output.h>
#include <crm/common/xml_internal.h>
#include <pe_status_private.h>
Include dependency graph for bundle.c:

Go to the source code of this file.

Macros

#define PE__CONTAINER_AGENT_UNKNOWN_S   "unknown"
 
#define PE__CONTAINER_AGENT_DOCKER_S   "docker"
 
#define PE__CONTAINER_AGENT_RKT_S   "rkt"
 
#define PE__CONTAINER_AGENT_PODMAN_S   "podman"
 
#define get_bundle_variant_data(data, rsc)
 
#define pe__set_bundle_mount_flags(mount_xml, flags, flags_to_set)
 

Typedefs

typedef struct pe__bundle_variant_data_s pe__bundle_variant_data_t
 

Enumerations

enum  pe__bundle_mount_flags { pe__bundle_mount_none = 0x00, pe__bundle_mount_subdir = 0x01 }
 
enum  pe__container_agent { PE__CONTAINER_AGENT_UNKNOWN, PE__CONTAINER_AGENT_DOCKER, PE__CONTAINER_AGENT_RKT, PE__CONTAINER_AGENT_PODMAN }
 

Functions

int pe__bundle_max (const pcmk_resource_t *rsc)
 
pcmk_resource_tpe__bundled_resource (const pcmk_resource_t *rsc)
 
const pcmk_resource_tpe__get_rsc_in_container (const pcmk_resource_t *instance)
 
bool pe__node_is_bundle_instance (const pcmk_resource_t *bundle, const pcmk_node_t *node)
 
pcmk_resource_tpe__first_container (const pcmk_resource_t *bundle)
 
void pe__foreach_bundle_replica (pcmk_resource_t *bundle, bool(*fn)(pe__bundle_replica_t *, void *), void *user_data)
 
void pe__foreach_const_bundle_replica (const pcmk_resource_t *bundle, bool(*fn)(const pe__bundle_replica_t *, void *), void *user_data)
 
bool pe__bundle_needs_remote_name (pcmk_resource_t *rsc)
 
const char * pe__add_bundle_remote_name (pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler, xmlNode *xml, const char *field)
 
gboolean pe__unpack_bundle (pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
 
gboolean pe__bundle_active (pcmk_resource_t *rsc, gboolean all)
 
pcmk_resource_tpe__find_bundle_replica (const pcmk_resource_t *bundle, const pcmk_node_t *node)
 
 PCMK__OUTPUT_ARGS ("bundle", "uint32_t", "pcmk_resource_t *", "GList *", "GList *")
 
void pe__print_bundle (pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
 
void pe__free_bundle (pcmk_resource_t *rsc)
 
enum rsc_role_e pe__bundle_resource_state (const pcmk_resource_t *rsc, gboolean current)
 
int pe_bundle_replicas (const pcmk_resource_t *rsc)
 Get the number of configured replicas in a bundle. More...
 
void pe__count_bundle (pcmk_resource_t *rsc)
 
gboolean pe__bundle_is_filtered (const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
 
GList * pe__bundle_containers (const pcmk_resource_t *bundle)
 
pcmk_node_tpe__bundle_active_node (const pcmk_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
 
unsigned int pe__bundle_max_per_node (const pcmk_resource_t *rsc)
 

Macro Definition Documentation

◆ get_bundle_variant_data

#define get_bundle_variant_data (   data,
  rsc 
)
Value:
CRM_ASSERT(rsc != NULL); \
CRM_ASSERT(rsc->variant == pcmk_rsc_variant_bundle); \
CRM_ASSERT(rsc->variant_opaque != NULL); \
data = (pe__bundle_variant_data_t *) rsc->variant_opaque;
struct pe__bundle_variant_data_s pe__bundle_variant_data_t
Bundle resource.
Definition: resources.h:37
#define CRM_ASSERT(expr)
Definition: results.h:42

Definition at line 81 of file bundle.c.

◆ PE__CONTAINER_AGENT_DOCKER_S

#define PE__CONTAINER_AGENT_DOCKER_S   "docker"

Definition at line 50 of file bundle.c.

◆ PE__CONTAINER_AGENT_PODMAN_S

#define PE__CONTAINER_AGENT_PODMAN_S   "podman"

Definition at line 52 of file bundle.c.

◆ PE__CONTAINER_AGENT_RKT_S

#define PE__CONTAINER_AGENT_RKT_S   "rkt"

Definition at line 51 of file bundle.c.

◆ PE__CONTAINER_AGENT_UNKNOWN_S

#define PE__CONTAINER_AGENT_UNKNOWN_S   "unknown"

Definition at line 49 of file bundle.c.

◆ pe__set_bundle_mount_flags

#define pe__set_bundle_mount_flags (   mount_xml,
  flags,
  flags_to_set 
)
Value:
do { \
flags = pcmk__set_flags_as(__func__, __LINE__, LOG_TRACE, \
"Bundle mount", ID(mount_xml), flags, \
(flags_to_set), #flags_to_set); \
} while (0)
#define LOG_TRACE
Definition: logging.h:38
#define ID(x)
Definition: msg_xml.h:474
uint64_t flags
Definition: remote.c:215

Definition at line 977 of file bundle.c.

Typedef Documentation

◆ pe__bundle_variant_data_t

typedef struct pe__bundle_variant_data_s pe__bundle_variant_data_t

Enumeration Type Documentation

◆ pe__bundle_mount_flags

Enumerator
pe__bundle_mount_none 
pe__bundle_mount_subdir 

Definition at line 23 of file bundle.c.

◆ pe__container_agent

Enumerator
PE__CONTAINER_AGENT_UNKNOWN 
PE__CONTAINER_AGENT_DOCKER 
PE__CONTAINER_AGENT_RKT 
PE__CONTAINER_AGENT_PODMAN 

Definition at line 42 of file bundle.c.

Function Documentation

◆ PCMK__OUTPUT_ARGS()

PCMK__OUTPUT_ARGS ( "bundle"  ,
"uint32_t"  ,
"pcmk_resource_t *"  ,
"GList *"  ,
"GList *"   
)

Definition at line 1450 of file bundle.c.

◆ pe__add_bundle_remote_name()

const char* pe__add_bundle_remote_name ( pcmk_resource_t rsc,
pcmk_scheduler_t scheduler,
xmlNode *  xml,
const char *  field 
)

Definition at line 938 of file bundle.c.

◆ pe__bundle_active()

gboolean pe__bundle_active ( pcmk_resource_t rsc,
gboolean  all 
)

Definition at line 1319 of file bundle.c.

◆ pe__bundle_active_node()

pcmk_node_t* pe__bundle_active_node ( const pcmk_resource_t rsc,
unsigned int *  count_all,
unsigned int *  count_clean 
)

Definition at line 2129 of file bundle.c.

◆ pe__bundle_containers()

GList* pe__bundle_containers ( const pcmk_resource_t bundle)

Definition at line 2113 of file bundle.c.

◆ pe__bundle_is_filtered()

gboolean pe__bundle_is_filtered ( const pcmk_resource_t rsc,
GList *  only_rsc,
gboolean  check_parent 
)

Definition at line 2069 of file bundle.c.

◆ pe__bundle_max()

int pe__bundle_max ( const pcmk_resource_t rsc)

Definition at line 96 of file bundle.c.

◆ pe__bundle_max_per_node()

unsigned int pe__bundle_max_per_node ( const pcmk_resource_t rsc)

Definition at line 2212 of file bundle.c.

◆ pe__bundle_needs_remote_name()

bool pe__bundle_needs_remote_name ( pcmk_resource_t rsc)

Definition at line 920 of file bundle.c.

◆ pe__bundle_resource_state()

enum rsc_role_e pe__bundle_resource_state ( const pcmk_resource_t rsc,
gboolean  current 
)

Definition at line 2018 of file bundle.c.

◆ pe__bundled_resource()

pcmk_resource_t* pe__bundled_resource ( const pcmk_resource_t rsc)

Definition at line 113 of file bundle.c.

◆ pe__count_bundle()

void pe__count_bundle ( pcmk_resource_t rsc)

Definition at line 2045 of file bundle.c.

◆ pe__find_bundle_replica()

pcmk_resource_t* pe__find_bundle_replica ( const pcmk_resource_t bundle,
const pcmk_node_t node 
)

Definition at line 1367 of file bundle.c.

◆ pe__first_container()

pcmk_resource_t* pe__first_container ( const pcmk_resource_t bundle)

Definition at line 187 of file bundle.c.

◆ pe__foreach_bundle_replica()

void pe__foreach_bundle_replica ( pcmk_resource_t bundle,
bool(*)(pe__bundle_replica_t *, void *)  fn,
void *  user_data 
)

Definition at line 210 of file bundle.c.

◆ pe__foreach_const_bundle_replica()

void pe__foreach_const_bundle_replica ( const pcmk_resource_t bundle,
bool(*)(const pe__bundle_replica_t *, void *)  fn,
void *  user_data 
)

Definition at line 234 of file bundle.c.

◆ pe__free_bundle()

void pe__free_bundle ( pcmk_resource_t rsc)

Definition at line 1984 of file bundle.c.

◆ pe__get_rsc_in_container()

const pcmk_resource_t* pe__get_rsc_in_container ( const pcmk_resource_t instance)

Definition at line 131 of file bundle.c.

◆ pe__node_is_bundle_instance()

bool pe__node_is_bundle_instance ( const pcmk_resource_t bundle,
const pcmk_node_t node 
)

Definition at line 161 of file bundle.c.

◆ pe__print_bundle()

void pe__print_bundle ( pcmk_resource_t rsc,
const char *  pre_text,
long  options,
void *  print_data 
)
Deprecated:
This function will be removed in a future release

Definition at line 1882 of file bundle.c.

◆ pe__unpack_bundle()

gboolean pe__unpack_bundle ( pcmk_resource_t rsc,
pcmk_scheduler_t scheduler 
)

Definition at line 984 of file bundle.c.

◆ pe_bundle_replicas()

int pe_bundle_replicas ( const pcmk_resource_t rsc)

Get the number of configured replicas in a bundle.

Parameters
[in]rscBundle resource
Returns
Number of configured replicas, or 0 on error

Definition at line 2032 of file bundle.c.