28 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CONF 73 char *
buf,
size_t buflen)
89 rc = snprintf(
buf, buflen,
"[%s.%s] ",
93 _buflen = strlen(
buf);
99 buf, buflen,
"[%s.%s] %s",
108 char *
buf,
size_t buflen)
132 char *
buf,
size_t buflen)
143 M0_CONF_ROOT_NODES_FID, M0_CONF_ANY_FID,
144 M0_CONF_NODE_PROCESSES_FID, M0_CONF_ANY_FID,
145 M0_CONF_PROCESS_SERVICES_FID, M0_CONF_ANY_FID);
148 for (
i = 0;
i <
rc; ++
i) {
150 if (
svc->cs_type == M0_CST_IOS) {
151 ++
stats->cs_nr_ioservices;
152 stats->cs_nr_iodevices +=
162 bool result =
r->rt_mdredundancy > 0;
164 FID_P(&
r->rt_obj.co_id),
r->rt_mdredundancy,
165 result ?
"true" :
"false");
170 char *
buf,
size_t buflen,
184 FID_F": metadata redundancy (%u) exceeds" 185 " the number of IO services (%u)",
188 stats->cs_nr_ioservices);
204 char *
buf,
size_t buflen)
216 if (
stats.cs_nr_ioservices == 0)
242 uint32_t nr_iodevs,
char *
buf,
size_t buflen)
251 " belong [0, P) range; P=%u",
257 buf, buflen,
FID_F": dev_idx is not unique," 258 " duplicates that of "FID_F,
270 buf, buflen,
FID_F": filename is not unique," 271 " duplicates that of "FID_F,
273 FID_P(&iodevs[j]->sd_obj.co_id));
291 uint32_t children_level;
296 if (m0_conf_dir_tlist_is_empty(
dir)) {
298 FID_F": Missing children",
334 FID_F": %s children",
337 "Missing" :
"Unexpected");
351 uint32_t *pver_width,
352 size_t pver_width_nr,
353 char *
buf,
size_t buflen)
365 &
pver->pv_u.subtree.pvs_sitevs->cd_obj, &st);
368 m0_forall(
i, pver_width_nr, (pver_width[
i] > 0))));
379 char *
buf,
size_t buflen)
401 char *
buf,
size_t buflen)
415 " formulaic pvers",
FID_P(&
pool->co_id));
427 " failures (%u) than there are objects (%u)" 428 " at level %d of base pver subtree",
431 base_attr = &
base->pv_u.subtree.pvs_attr;
437 " failures (%u) > P - N - K - S of base pver",
450 char *
buf,
size_t buflen)
467 " supported only with N = 1",
472 " failures (%u) than there are objects (%u)" 473 " at level %d of pver subtree",
484 FID_F": Pool width (%u) exceeds total" 485 " number of IO devices (%u)",
490 M0_CONF_PVER_SITEVS_FID, M0_CONF_ANY_FID,
491 M0_CONF_SITEV_RACKVS_FID, M0_CONF_ANY_FID,
492 M0_CONF_RACKV_ENCLVS_FID, M0_CONF_ANY_FID,
493 M0_CONF_ENCLV_CTRLVS_FID, M0_CONF_ANY_FID,
494 M0_CONF_CTRLV_DRIVEVS_FID, M0_CONF_ANY_FID);
497 for (
i = 0;
i <
rc; ++
i) {
502 iodevs, nr_iodevs,
buf, buflen);
529 if (
stats.cs_nr_iodevices == 0)
537 M0_CONF_ROOT_POOLS_FID, M0_CONF_ANY_FID,
538 M0_CONF_POOL_PVERS_FID, M0_CONF_ANY_FID);
541 for (
i = 0;
i <
rc; ++
i) {
545 stats.cs_nr_iodevices,
560 char *
buf,
size_t buflen)
574 M0_CONF_PROCESS_SERVICES_FID, M0_CONF_ANY_FID);
577 for (
i = 0;
i <
rc; ++
i) {
580 *epp !=
NULL; ++epp) {
584 FID_F": Invalid endpoint: %s",
602 M0_CONF_ROOT_NODES_FID, M0_CONF_ANY_FID,
603 M0_CONF_NODE_PROCESSES_FID, M0_CONF_ANY_FID);
606 for (
i = 0;
i <
rc; ++
i) {
618 char *
buf,
size_t buflen)
623 bool confd_p =
false;
628 M0_CONF_ROOT_NODES_FID, M0_CONF_ANY_FID,
629 M0_CONF_NODE_PROCESSES_FID, M0_CONF_ANY_FID,
630 M0_CONF_PROCESS_SERVICES_FID, M0_CONF_ANY_FID);
633 for (
i = 0;
i <
rc; ++
i) {
639 FID_F": Invalid service type: %d",
641 if (svc_type == M0_CST_CONFD)
653 char *
buf,
size_t buflen)
655 bool has_sdevs = !m0_conf_dir_tlist_is_empty(&
svc->cs_sdevs->cd_items);
657 if (M0_IN(
svc->cs_type, (M0_CST_IOS, M0_CST_CAS)))
660 FID_F": `sdevs' of %s service must not be empty",
662 svc->cs_type == M0_CST_IOS ?
"an IO" :
"a CAS");
665 FID_F": `sdevs' must be empty (neither IOS nor CAS)",
670 char *
buf,
size_t buflen)
679 M0_CONF_ROOT_NODES_FID, M0_CONF_ANY_FID,
680 M0_CONF_NODE_PROCESSES_FID, M0_CONF_ANY_FID,
681 M0_CONF_PROCESS_SERVICES_FID, M0_CONF_ANY_FID);
684 for (
i = 0;
i <
rc; ++
i) {
698 #define _ENTRY(name) { #name, name } 710 #undef M0_TRACE_SUBSYSTEM const struct m0_conf_obj_type * m0_conf_obj_type(const struct m0_conf_obj *obj)
static char * conf_pver_width_error(const struct m0_conf_pver *pver, uint32_t *pver_width, size_t pver_width_nr, char *buf, size_t buflen)
M0_INTERNAL bool m0_net_endpoint_is_valid(const char *endpoint)
#define M0_ALLOC_ARR(arr, nr)
const struct m0_conf_obj_type M0_CONF_OBJV_TYPE
#define m0_conf_glob_init(glob, flags, errfunc, cache, origin,...)
static char * _conf_root_error(const struct m0_conf_root *root, char *buf, size_t buflen, struct conf_io_stats *stats)
struct m0_pdclust_attr pvs_attr
static int conf_pver_width_measure_w(struct m0_conf_obj *obj, void *args)
struct m0_conf_obj rt_obj
M0_INTERNAL struct m0_conf_obj * m0_conf_cache_lookup(const struct m0_conf_cache *cache, const struct m0_fid *id)
#define M0_LOG(level,...)
enum m0_trace_level level
const struct m0_conf_obj_type M0_CONF_PVER_TYPE
const struct m0_conf_obj_type M0_CONF_ROOT_TYPE
struct m0_conf_obj pv_obj
static const struct m0_conf_ruleset * conf_validity_checks[]
#define m0_exists(var, nr,...)
uint32_t cs_nr_ioservices
struct m0_conf_cache * co_cache
static char * _conf_service_sdevs_error(const struct m0_conf_service *svc, char *buf, size_t buflen)
M0_INTERNAL unsigned m0_conf_pver_level(const struct m0_conf_obj *obj)
static const struct m0_conf_node * conf_node_from_sdev(const struct m0_conf_sdev *sdev)
M0_INTERNAL bool m0_conf_obj_is_stub(const struct m0_conf_obj *obj)
static char * conf_iodev_error(const struct m0_conf_sdev *sdev, const struct m0_conf_sdev **iodevs, uint32_t nr_iodevs, char *buf, size_t buflen)
enum m0_conf_pver_kind pv_kind
M0_INTERNAL int m0_conf_walk(int(*fn)(struct m0_conf_obj *obj, void *args), struct m0_conf_obj *origin, void *args)
struct m0_conf_root * root
static char * conf_pver_formulaic_error(const struct m0_conf_pver *fpver, char *buf, size_t buflen)
static bool m0_conf_service_type_is_valid(enum m0_conf_service_type t)
M0_INTERNAL char * m0_conf_glob_error(const struct m0_conf_glob *glob, char *buf, size_t buflen)
union m0_conf_pver::@122 pv_u
struct m0_conf_obj * m0_conf_obj_grandparent(const struct m0_conf_obj *obj)
uint32_t pvs_tolerance[M0_CONF_PVER_HEIGHT]
static uint32_t m0_conf_dir_len(const struct m0_conf_dir *dir)
static char * conf_service_sdevs_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
static int conf_pver_width_measure__dir(const struct m0_conf_obj *obj, struct conf_pver_width_st *st)
M0_INTERNAL bool m0_conf_cache_is_locked(const struct m0_conf_cache *cache)
static char * conf_pver_actual_error(const struct m0_conf_pver *pver, const struct m0_conf_sdev **iodevs, uint32_t nr_iodevs, char *buf, size_t buflen)
static char * conf_process_endpoint_error(const struct m0_conf_process *proc, char *buf, size_t buflen)
char * m0_conf_validation_error(struct m0_conf_cache *cache, char *buf, size_t buflen)
static char * conf_root_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
#define M0_CONF_CAST(ptr, type)
char *(* cvr_error)(const struct m0_conf_cache *cache, char *buf, size_t buflen)
static struct m0_pool pool
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
#define m0_forall(var, nr,...)
struct m0_conf_obj pc_obj
static const struct m0_conf_ruleset conf_rules
static char * conf_io_stats_get(const struct m0_conf_cache *cache, struct conf_io_stats *stats, char *buf, size_t buflen)
M0_INTERNAL char * m0_conf_validation_error_locked(const struct m0_conf_cache *cache, char *buf, size_t buflen)
static char * conf_endpoint_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
static bool conf_oostore_mode(const struct m0_conf_root *r)
struct m0_conf_pver_formulaic formulaic
static struct m0_net_test_service svc
struct m0_conf_obj sd_obj
static char * conf_pvers_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
static char * conf_orphans_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
struct m0_conf_dir * cv_children
M0_INTERNAL int m0_conf_glob(struct m0_conf_glob *glob, uint32_t nr, const struct m0_conf_obj **objv)
M0_INTERNAL void m0_conf_cache_lock(struct m0_conf_cache *cache)
const struct m0_conf_obj_type M0_CONF_DIR_TYPE
#define m0_tl_for(name, head, obj)
M0_INTERNAL void m0_conf_cache_unlock(struct m0_conf_cache *cache)
#define m0_tl_exists(name, var, head,...)
struct m0_conf_obj * cv_real
static char * conf_pver_formulaic_base_error(const struct m0_conf_pver *fpver, const struct m0_conf_pver **out, char *buf, size_t buflen)
static char * conf_service_type_error(const struct m0_conf_cache *cache, char *buf, size_t buflen)
M0_INTERNAL char * m0_vsnprintf(char *buf, size_t buflen, const char *format,...)
#define m0_tl_forall(name, var, head,...)
M0_INTERNAL bool m0_pdclust_attr_check(const struct m0_pdclust_attr *attr)