else if (ceph_argparse_witharg(args, i, &val,
as_option.c_str(), (char*)NULL)) {
if (oss && (
- ((opt->type == OPT_STR) || (opt->type == OPT_ADDR)) &&
+ ((opt->type == OPT_STR) || (opt->type == OPT_ADDR) ||
+ (opt->type == OPT_UUID)) &&
(observers.find(opt->name) == observers.end()))) {
*oss << "You cannot change " << opt->name << " using injectargs.\n";
ret = -ENOSYS;
if (strcmp(opt->name, k.c_str()) == 0) {
if (internal_safe_to_start_threads) {
// If threads have been started...
- if ((opt->type == OPT_STR) || (opt->type == OPT_ADDR)) {
+ if ((opt->type == OPT_STR) || (opt->type == OPT_ADDR) ||
+ (opt->type == OPT_UUID)) {
// And this is NOT an integer valued variable....
if (observers.find(opt->name) == observers.end()) {
// And there is no observer to safely change it...
case OPT_U64:
oss << *(uint64_t*)opt->conf_ptr(this);
break;
- case OPT_ADDR: {
+ case OPT_ADDR:
oss << *(entity_addr_t*)opt->conf_ptr(this);
break;
- }
+ case OPT_UUID:
+ oss << *(uuid_d*)opt->conf_ptr(this);
+ break;
}
string str(oss.str());
int l = strlen(str.c_str()) + 1;
}
return 0;
}
+ case OPT_UUID: {
+ uuid_d *u = (uuid_d*)opt->conf_ptr(this);
+ if (!u->parse(val))
+ return -EINVAL;
+ return 0;
+ }
}
return -ENOSYS;
}
#define OPTION_OPT_ADDR(name) const entity_addr_t name;
#define OPTION_OPT_U32(name) const uint32_t name;
#define OPTION_OPT_U64(name) const uint64_t name;
+#define OPTION_OPT_UUID(name) const uuid_d name;
#define OPTION(name, ty, init) OPTION_##ty(name)
#define SUBSYS(name, log, gather)
#define DEFAULT_SUBSYS(log, gather)
#undef OPTION_OPT_ADDR
#undef OPTION_OPT_U32
#undef OPTION_OPT_U64
+#undef OPTION_OPT_UUID
#undef OPTION
#undef SUBSYS
#undef DEFAULT_SUBSYS
typedef enum {
OPT_INT, OPT_LONGLONG, OPT_STR, OPT_DOUBLE, OPT_FLOAT, OPT_BOOL,
- OPT_ADDR, OPT_U32, OPT_U64
+ OPT_ADDR, OPT_U32, OPT_U64, OPT_UUID
} opt_type_t;
bool ceph_resolve_file_search(const std::string& filename_list,