Whamcloud - gitweb
Remind the user to use 'cfg_device' to set target device for config commands.
authorrread <rread>
Fri, 7 Nov 2003 06:19:32 +0000 (06:19 +0000)
committerrread <rread>
Fri, 7 Nov 2003 06:19:32 +0000 (06:19 +0000)
lustre/utils/lustre_cfg.c

index 6709552..0be3b3f 100644 (file)
@@ -146,6 +146,13 @@ int jt_lcfg_setup(int argc, char **argv)
         struct lustre_cfg lcfg;
         int rc;
 
+        if (lcfg_devname == NULL) {
+                fprintf(stderr, "%s: please use 'cfg_device name' to set the "
+                        "device name for config commands.\n", 
+                        jt_cmdname(argv[0])); 
+               return -EINVAL;
+        }
+
         LCFG_INIT(lcfg, LCFG_SETUP, lcfg_devname);
 
         if (argc > 5)
@@ -181,6 +188,13 @@ int jt_obd_detach(int argc, char **argv)
         struct lustre_cfg lcfg;
         int rc;
 
+        if (lcfg_devname == NULL) {
+                fprintf(stderr, "%s: please use 'cfg_device name' to set the "
+                        "device name for config commands.\n", 
+                        jt_cmdname(argv[0])); 
+               return -EINVAL;
+        }
+
         LCFG_INIT(lcfg, LCFG_DETACH, lcfg_devname);
 
         if (argc != 1)
@@ -203,6 +217,13 @@ int jt_obd_cleanup(int argc, char **argv)
         int flag_cnt = 0, n;
         int rc;
 
+        if (lcfg_devname == NULL) {
+                fprintf(stderr, "%s: please use 'cfg_device name' to set the "
+                        "device name for config commands.\n", 
+                        jt_cmdname(argv[0])); 
+               return -EINVAL;
+        }
+
         LCFG_INIT(lcfg, LCFG_CLEANUP, lcfg_devname);
 
         if (argc < 1 || argc > 3)