Whamcloud - gitweb
LU-6245 tests: remove libcfs.h from lctl code
[fs/lustre-release.git] / lnet / utils / lnetctl.c
index 978da69..831543d 100644 (file)
  * Author:
  *   Amir Shehata <amir.shehata@intel.com>
  */
-
+#include <getopt.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <getopt.h>
+#include <string.h>
+#include <libcfs/util/parser.h>
 #include <lnet/lnetctl.h>
-#include <libcfs/libcfsutil.h>
 #include "cyaml/cyaml.h"
 #include "lnetconfig/liblnetconfig.h"
 
@@ -976,7 +976,7 @@ command_t list[] = {
                                 "--help} FILE.yaml"},
        {"export", jt_export, 0, "export {--help} FILE.yaml"},
        {"stats", jt_stats, 0, "stats {show | help}"},
-       {"peer_credits", jt_peer_credits, 0, "stats {show | help}"},
+       {"peer_credits", jt_peer_credits, 0, "peer_credits {show | help}"},
        {"help", Parser_help, 0, "help"},
        {"exit", Parser_quit, 0, "quit"},
        {"quit", Parser_quit, 0, "quit"},
@@ -996,14 +996,6 @@ int main(int argc, char **argv)
                return rc;
        }
 
-       rc = libcfs_arch_init();
-       if (rc < 0) {
-               cYAML_build_error(-1, -1, "lnetctl", "startup",
-                                 "cannot initialize libcfs", &err_rc);
-               cYAML_print_tree2file(stderr, err_rc);
-               return rc;
-       }
-
        Parser_init("lnetctl > ", list);
        if (argc > 1) {
                rc = Parser_execarg(argc - 1, &argv[1], list);
@@ -1013,6 +1005,5 @@ int main(int argc, char **argv)
        Parser_commands();
 
 errorout:
-       libcfs_arch_cleanup();
        return rc;
 }