conf.parse_env(cct->get_module_type()); // environment variables override
conf.apply_changes(nullptr);
+ auto fsid = conf.get_val<uuid_d>("fsid");
+ fsid.print(cci->cci_fsid);
+
ceph::async::io_context_pool ioc(1);
MonClient monc = MonClient(cct.get(), ioc);
err = monc.build_initial_monmap();
struct ceph_config_info *cci;
/* Don't do anything if we already have requisite info */
- if (cmi->cmi_secret[0] && cmi->cmi_mons)
+ if (cmi->cmi_secret[0] && cmi->cmi_mons && cmi->cmi_fsid)
return 0;
cci = mmap((void *)0, sizeof(*cci), PROT_READ | PROT_WRITE,
if (len < MON_LIST_BUFSIZE)
cmi->cmi_mons = strndup(cci->cci_mons, len + 1);
}
+ if (!cmi->cmi_fsid) {
+ len = strnlen(cci->cci_fsid, CLUSTER_FSID_LEN);
+ if (len < CLUSTER_FSID_LEN)
+ cmi->cmi_fsid = strndup(cci->cci_fsid, len + 1);
+ }
}
out:
munmap(cci, sizeof(*cci));
/* 2k should be enough for anyone? */
#define MON_LIST_BUFSIZE 2048
+#define CLUSTER_FSID_LEN 37
+
void mount_ceph_debug(const char *fmt, ...);
struct ceph_config_info {
char cci_secret[SECRET_BUFSIZE]; // auth secret
char cci_mons[MON_LIST_BUFSIZE]; // monitor addrs
+ char cci_fsid[CLUSTER_FSID_LEN]; // cluster fsid
};
void mount_ceph_get_config_info(const char *config_file, const char *name,