if (strchr(nidstr, '*')) {
snprintf(err_str, LNET_MAX_STR_LEN,
- "asterisk not allowed in nidstring \"%s\"", nidstr);
+ "asterisk not allowed in nidstring '%s'", nidstr);
return LUSTRE_CFG_RC_BAD_PARAM;
}
INIT_LIST_HEAD(&nidlist);
if (!cfs_parse_nidlist(nidstr, strlen(nidstr), &nidlist)) {
snprintf(err_str, LNET_MAX_STR_LEN,
- "Unable to parse nidlist from: %s\n", nidstr);
+ "\"Unable to parse nidlist from: %s\"", nidstr);
return LUSTRE_CFG_RC_BAD_PARAM;
}
if (num_nids == -1) {
snprintf(err_str, LNET_MAX_STR_LEN,
- "\"%s\" specifies more than the %d NIDs allowed by this operation.",
+ "\"'%s' specifies more than the %d NIDs allowed by this operation\"",
nidstr, max_nids);
return LUSTRE_CFG_RC_BAD_PARAM;
}
if (num_nids < 0) {
snprintf(err_str, LNET_MAX_STR_LEN,
- "Failed to expand nidstr: %s", strerror(num_nids));
+ "\"Failed to expand nidstr: %s\"", strerror(num_nids));
return LUSTRE_CFG_RC_OUT_OF_MEM;
}
if (num_nids == 0) {
snprintf(err_str, LNET_MAX_STR_LEN,
- "\"%s\" did not expand to any nids", nidstr);
+ "\"'%s' did not expand to any nids\"", nidstr);
return LUSTRE_CFG_RC_BAD_PARAM;
}
rc = l_ioctl(LNET_DEV_ID, ioc_call, &ping);
if (rc != 0) {
snprintf(err_str,
- sizeof(err_str), "failed to %s %s: %s\n", oper,
+ sizeof(err_str),
+ "\"failed to %s %s: %s\"",
+ oper,
id.pid == LNET_PID_ANY ?
libcfs_nid2str(id.nid) :
libcfs_id2str(id), strerror(errno));
if (pnid == LNET_NID_ANY) {
rc = LUSTRE_CFG_RC_BAD_PARAM;
snprintf(err_str, LNET_MAX_STR_LEN,
- "badly formatted primary NID: %s", prim_nid);
+ "\"badly formatted primary NID: %s\"", prim_nid);
goto out;
}
errno != EHOSTUNREACH) {
rc = -errno;
snprintf(err_str, LNET_MAX_STR_LEN,
- "route operation failed: %s",
+ "\"route operation failed: %s\"",
strerror(errno));
goto out;
} else if (errno == EEXIST) {
int sen, int seq_no, struct cYAML **err_rc)
{
int rc;
- char err_str[LNET_MAX_STR_LEN] = "\"generic error\"";
+ char err_str[LNET_MAX_STR_LEN] = "generic error";
if (hops == -1) {
hops = LNET_UNDEFINED_HOPS;
} else if (hops < 1 || hops > 255) {
snprintf(err_str, LNET_MAX_STR_LEN,
- "\"invalid hop count %d, must be between 1 and 255\"",
+ "invalid hop count %d, must be between 1 and 255",
hops);
rc = LUSTRE_CFG_RC_OUT_OF_RANGE_PARAM;
goto out;
prio = 0;
} else if (prio < 0) {
snprintf(err_str, LNET_MAX_STR_LEN,
- "\"invalid priority %d, must be greater than 0\"",
+ "invalid priority %d, must be greater than 0",
prio);
rc = LUSTRE_CFG_RC_OUT_OF_RANGE_PARAM;
goto out;
sen = 1;
} else if (sen < 1) {
snprintf(err_str, LNET_MAX_STR_LEN,
- "\"invalid health sensitivity %d, must be 1 or greater\"",
+ "invalid health sensitivity %d, must be 1 or greater",
sen);
rc = LUSTRE_CFG_RC_OUT_OF_RANGE_PARAM;
goto out;
} else
rc = LUSTRE_CFG_RC_NO_ERR;
- snprintf(err_str, sizeof(err_str), "\"success\"");
+ snprintf(err_str, sizeof(err_str), "success");
out:
if (show_rc == NULL || rc != LUSTRE_CFG_RC_NO_ERR || !exist) {
cYAML_free_tree(root);
int rc;
if (!tmp && !tmp2) {
- *errmsg = "Unable to parse nidlist: [] are missing";
+ *errmsg = "\"Unable to parse nidlist: [] are missing\"";
return -ERANGE;
}
if ((tmp && !tmp2) || (!tmp && tmp2)) {
- *errmsg = "Unable to parse nidlist: incomplete bracket set";
+ *errmsg = "\"Unable to parse nidlist: incomplete bracket set\"";
return -EINVAL;
}
if (range > tmp2) {
- *errmsg = "Unable to parse nidlist: improper bracket ordering";
+ *errmsg = "\"Unable to parse nidlist: improper bracket ordering\"";
return -EINVAL;
}
} else if (*range == '-') {
range++;
if (!isxdigit(*range)) {
- *errmsg = "Unable to parse nidlist: range needs number after -";
+ *errmsg = "\"Unable to parse nidlist: range needs number after -\"";
return -ERANGE;
}
} else if (*range == '/') {
range++;
if (!isdigit(*range)) {
- *errmsg = "Unable to parse nidlist: range needs number after /";
+ *errmsg = "\"Unable to parse nidlist: range needs number after /\"";
return -ERANGE;
}
range++;
if (!isxdigit(*range)) {
- *errmsg = "Unable to parse nidlist: range needs number after ,";
+ *errmsg = "\"Unable to parse nidlist: range needs number after ,\"";
return -ERANGE;
}
last = strtoul(num, NULL, base);
if (first > last) {
- *errmsg = "Unable to parse nidlist: range is wrong order";
+ *errmsg = "\"Unable to parse nidlist: range is wrong order\"";
return -ERANGE;
}
} else {
item = calloc(1, sizeof(struct nid_node));
if (!item) {
- *errmsg = "Unable to parse nidlist: allocation failed";
+ *errmsg = "\"Unable to parse nidlist: allocation failed\"";
return -ENOMEM;
}
snprintf(item->nidstr, sizeof(item->nidstr),
item = calloc(1, sizeof(struct nid_node));
if (!item) {
- *errmsg = "Unable to parse nidlist: allocation failed";
+ *errmsg = "\"Unable to parse nidlist: allocation failed\"";
return -ENOMEM;
}
snprintf(item->nidstr, sizeof(item->nidstr),
memset(num, 0, sizeof(num));
off = 0;
} else {
- *errmsg = "Unable to parse nidlist: invalid character in range";
+ *errmsg = "\"Unable to parse nidlist: invalid character in range\"";
return -EINVAL;
}
}
int len = strlen(nid);
if (first > last) {
- *errmsg = "Unable to parse nidlist: range is wrong order";
+ *errmsg = "\"Unable to parse nidlist: range is wrong order\"";
return -ERANGE;
}
item = calloc(1, sizeof(struct nid_node));
if (!item) {
- *errmsg = "Unable to parse nidlist: allocation failed";
+ *errmsg = "\"Unable to parse nidlist: allocation failed\"";
return -ENOMEM;
}
snprintf(item->nidstr, sizeof(item->nidstr),
}
if (strstr(nidstr, "<?>")) {
- *errmsg = "Unable to parse nidlist: LNET_ANY_NID is unsupported";
+ *errmsg = "\"Unable to parse nidlist: LNET_ANY_NID is unsupported\"";
return -EINVAL;
}
if (strchr(nidstr, '@') == NULL) {
- *errmsg = "Unable to parse nidlist: no valid NIDs in string";
+ *errmsg = "\"Unable to parse nidlist: no valid NIDs in string\"";
return -EINVAL;
}
item = calloc(1, sizeof(struct nid_node));
if (!item) {
- *errmsg = "Unable to parse nidlist: allocation failed";
+ *errmsg = "\"Unable to parse nidlist: allocation failed\"";
rc = -ENOMEM;
goto err;
}
*/
rc = libcfs_strnid(&NID, orig);
if (rc < 0) {
- *errmsg = "Unable to parse nidlist: invalid NID in nidstr";
+ *errmsg = "\"Unable to parse nidlist: invalid NID in nidstr\"";
goto err;
}
if (rc != 0) {
rc = -errno;
snprintf(err_str,
- sizeof(err_str), "Can not configure health value: %s",
+ sizeof(err_str), "\"Can not configure health value: %s\"",
strerror(errno));
}
if (rc != 0) {
rc = -errno;
snprintf(err_str,
- sizeof(err_str), "Can not set peer property: %s",
+ sizeof(err_str), "\"Can not set peer property: %s\"",
strerror(errno));
}
rc = -errno;
snprintf(err_str,
sizeof(err_str),
- "Can not configure conns_per_peer value: %s",
+ "\"Can not configure conns_per_peer value: %s\"",
strerror(errno));
}
}
goto out;
}
- snprintf(err_str, sizeof(err_str), "success\n");
+ snprintf(err_str, sizeof(err_str), "success");
rc = 0;
if (pnid == LNET_NID_ANY) {
rc = LUSTRE_CFG_RC_BAD_PARAM;
snprintf(err_str, LNET_MAX_STR_LEN,
- "badly formatted primary NID: %s", peer_nid);
+ "\"badly formatted primary NID: %s\"", peer_nid);
goto out;
}
if (!show_rc)
cYAML_print_tree(root);
- snprintf(err_str, sizeof(err_str), "\"success\"");
+ snprintf(err_str, sizeof(err_str), "success");
rc = LUSTRE_CFG_RC_NO_ERR;
out:
if (show_rc == NULL || rc != LUSTRE_CFG_RC_NO_ERR) {
strerror(l_errno));
rc = -l_errno;
} else {
- snprintf(err_str, sizeof(err_str), "\"success\"");
+ snprintf(err_str, sizeof(err_str), "success");
rc = LUSTRE_CFG_RC_NO_ERR;
}
if (!prim_nid) {
rc = LUSTRE_CFG_RC_BAD_PARAM;
snprintf(err_str, LNET_MAX_STR_LEN,
- "\"primary nid\" must be specified");
+ "the 'primary nid' must be specified");
goto failed;
}
if (pnid == LNET_NID_ANY) {
rc = LUSTRE_CFG_RC_BAD_PARAM;
snprintf(err_str, LNET_MAX_STR_LEN,
- "badly formatted primary NID: %s", prim_nidstr);
+ "\"badly formatted primary NID: %s\"", prim_nidstr);
goto failed;
}
else if (strcmp(mr->cy_valuestring, "True") != 0) {
rc = LUSTRE_CFG_RC_BAD_PARAM;
snprintf(err_str, LNET_MAX_STR_LEN,
- "Multi-Rail must be set to \"True\" or \"False\" found \"%s\"",
+ "Multi-Rail must be set to 'True' or 'False' found '%s'",
mr->cy_valuestring);
goto failed;
}
cb = lookup_fn(child->cy_string, table);
if (cb == NULL) {
snprintf(err_str, sizeof(err_str),
- "\"call back for '%s' not found\"",
+ "call back for '%s' not found",
child->cy_string);
cYAML_build_error(LUSTRE_CFG_RC_BAD_PARAM, -1,
"yaml", "helper", err_str, err_rc);