Whamcloud - gitweb
LU-4961 lustre: remove liblustre.h and obd.h from userspace
[fs/lustre-release.git] / lustre / utils / lustre_cfg.c
index 4036828..6c8355d 100644 (file)
 #include <ctype.h>
 #include <glob.h>
 
-#ifndef __KERNEL__
-#include <liblustre.h>
-#endif
-#include <lustre_lib.h>
+#include <libcfs/libcfs.h>
 #include <lustre_cfg.h>
 #include <lustre/lustre_idl.h>
-#include <lustre_dlm.h>
-#include <obd.h>          /* for struct lov_stripe_md */
-#include <obd_lov.h>
 #include <lustre/lustre_build_version.h>
 
 #include <unistd.h>
@@ -307,11 +301,6 @@ int jt_lcfg_add_uuid(int argc, char **argv)
         return do_add_uuid(argv[0], argv[1], nid);
 }
 
-int obd_add_uuid(char *uuid, lnet_nid_t nid)
-{
-        return do_add_uuid("obd_add_uuid", uuid, nid);
-}
-
 int jt_lcfg_del_uuid(int argc, char **argv)
 {
         int rc;
@@ -576,13 +565,13 @@ static int jt_lcfg_mgsparam2(int argc, char **argv, struct param_opts *popt)
  * AT NEXT REBOOT, not immediately. */
 int jt_lcfg_mgsparam(int argc, char **argv)
 {
-        int rc;
-        int del = 0;
-        struct lustre_cfg_bufs bufs;
-        struct lustre_cfg *lcfg;
-        char *buf = NULL;
+       int rc;
+       int del = 0;
+       struct lustre_cfg_bufs bufs;
+       struct lustre_cfg *lcfg;
+       char *buf = NULL;
 
-#if LUSTRE_VERSION >= OBD_OCD_VERSION(2,7,53,0)
+#if LUSTRE_VERSION_CODE >= OBD_OCD_VERSION(2, 7, 53, 0)
        fprintf(stderr, "warning: 'lctl conf_param' is deprecated, "
                "use 'lctl set_param -P' instead\n");
 #endif
@@ -1088,6 +1077,8 @@ int jt_lcfg_setparam(int argc, char **argv)
                         *value = '\0';
                         value ++;
                         path = argv[i];
+                       if (*value == '\0')
+                               break;
                 } else {
                         /* format: set_param a b */
                         if (path == NULL) {
@@ -1108,6 +1099,9 @@ int jt_lcfg_setparam(int argc, char **argv)
                if (rc2 < 0 && rc == 0)
                        rc = rc2;
        }
+       if (path != NULL && (value == NULL || *value == '\0'))
+               fprintf(stderr, "error: %s: setting %s=: %s\n",
+                       jt_cmdname(argv[0]), path, strerror(rc = EINVAL));
 
        return rc;
 }