From: Sonia Date: Fri, 27 Oct 2017 10:14:29 +0000 (-0700) Subject: LU-10151 lnet: report better config error with lnetctl X-Git-Tag: 2.10.56~66 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=dcaed70d42002fb5e3ab9753780f0e494e2a1c20;p=fs%2Flustre-release.git LU-10151 lnet: report better config error with lnetctl Configuring net or route currently reports generic message on error. Adding specific error message for the missing parameters. With importing config from yaml file, specific error messages help in finding the exact error. Change-Id: I7d9bdeb2280f4548897d9958aab7d451b981e8bd Signed-off-by: Sonia Sharma Test-Parameters: trivial Reviewed-on: https://review.whamcloud.com/29820 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Amir Shehata Reviewed-by: James Simmons Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- diff --git a/lnet/utils/lnetconfig/liblnetconfig.c b/lnet/utils/lnetconfig/liblnetconfig.c index 969143b..2df6a36 100644 --- a/lnet/utils/lnetconfig/liblnetconfig.c +++ b/lnet/utils/lnetconfig/liblnetconfig.c @@ -822,7 +822,7 @@ int lustre_lnet_config_route(char *nw, char *gw, int hops, int prio, if (nw == NULL || gw == NULL) { snprintf(err_str, sizeof(err_str), - "\"missing mandatory parameter(s): '%s'\"", + "\"missing mandatory parameter in route config:'%s'\"", (nw == NULL && gw == NULL) ? "network, gateway" : (nw == NULL) ? "network" : "gateway"); rc = LUSTRE_CFG_RC_MISSING_PARAM; @@ -905,7 +905,7 @@ int lustre_lnet_del_route(char *nw, char *gw, if (nw == NULL || gw == NULL) { snprintf(err_str, sizeof(err_str), - "\"missing mandatory parameter(s): '%s'\"", + "\"missing mandatory parameter in route delete: '%s'\"", (nw == NULL && gw == NULL) ? "network, gateway" : (nw == NULL) ? "network" : "gateway"); rc = LUSTRE_CFG_RC_MISSING_PARAM; @@ -1546,7 +1546,9 @@ int lustre_lnet_config_ni(struct lnet_dlc_network_descr *nw_descr, list_empty(&nw_descr->nw_intflist))) { snprintf(err_str, sizeof(err_str), - "\"missing mandatory parameters\""); + "\"missing mandatory parameters in NI config: '%s'\"", + (nw_descr == NULL) ? "network , interface" : + (nw_descr->nw_id == 0) ? "network" : "interface"); rc = LUSTRE_CFG_RC_MISSING_PARAM; goto out; } @@ -1684,7 +1686,9 @@ int lustre_lnet_del_ni(struct lnet_dlc_network_descr *nw_descr, list_empty(&nw_descr->nw_intflist)) { snprintf(err_str, sizeof(err_str), - "\"missing mandatory parameter\""); + "\"missing mandatory parameter in deleting NI: '%s'\"", + (nw_descr == NULL) ? "network , interface" : + (nw_descr->nw_id == 0) ? "network" : "interface"); rc = LUSTRE_CFG_RC_MISSING_PARAM; goto out; }