+static int jt_show_recovery(int argc, char **argv)
+{
+ int rc, opt;
+ struct cYAML *err_rc = NULL, *show_rc = NULL;
+
+ const char *const short_options = "lp";
+ static const struct option long_options[] = {
+ { .name = "local", .has_arg = no_argument, .val = 'l' },
+ { .name = "peer", .has_arg = no_argument, .val = 'p' },
+ { .name = NULL } };
+
+ rc = check_cmd(debug_cmds, "recovery", NULL, 0, argc, argv);
+ if (rc)
+ return rc;
+
+ while ((opt = getopt_long(argc, argv, short_options,
+ long_options, NULL)) != -1) {
+ switch (opt) {
+ case 'l':
+ rc = lustre_lnet_show_local_ni_recovq(-1, &show_rc, &err_rc);
+ break;
+ case 'p':
+ rc = lustre_lnet_show_peer_ni_recovq(-1, &show_rc, &err_rc);
+ break;
+ default:
+ return 0;
+ }
+ }
+
+ if (rc != LUSTRE_CFG_RC_NO_ERR)
+ cYAML_print_tree2file(stderr, err_rc);
+ else if (show_rc)
+ cYAML_print_tree(show_rc);
+
+ cYAML_free_tree(err_rc);
+ cYAML_free_tree(show_rc);
+
+ return rc;
+}
+