Blob Blame History Raw
From 0dc5bcf0ee82f6d6dc42a92e6564b93740b3c7ee Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Mon, 3 Sep 2018 15:29:19 +0200
Subject: [PATCH] fence_kdump: add validate-all action

---
 agents/kdump/fence_kdump.c | 6 +++++-
 agents/kdump/options.h     | 3 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/agents/kdump/fence_kdump.c b/agents/kdump/fence_kdump.c
index 768a9344..4ab2dd9b 100644
--- a/agents/kdump/fence_kdump.c
+++ b/agents/kdump/fence_kdump.c
@@ -295,6 +295,7 @@ do_action_metadata (const char *self)
     fprintf (stdout, "\t<action name=\"off\" />\n");
     fprintf (stdout, "\t<action name=\"monitor\" />\n");
     fprintf (stdout, "\t<action name=\"metadata\" />\n");
+    fprintf (stdout, "\t<action name=\"validate-all\" />\n");
     fprintf (stdout, "</actions>\n");
 
     fprintf (stdout, "</resource-agent>\n");
@@ -316,7 +317,7 @@ print_usage (const char *self)
     fprintf (stdout, "%s\n",
              "  -f, --family=FAMILY          Network family: ([auto], ipv4, ipv6)");
     fprintf (stdout, "%s\n",
-             "  -o, --action=ACTION          Fencing action: ([off], monitor, metadata)");
+             "  -o, --action=ACTION          Fencing action: ([off], monitor, metadata, validate-all)");
     fprintf (stdout, "%s\n",
              "  -t, --timeout=TIMEOUT        Timeout in seconds (default: 60)");
     fprintf (stdout, "%s\n",
@@ -556,6 +557,9 @@ main (int argc, char **argv)
     case FENCE_KDUMP_ACTION_MONITOR:
         error = do_action_monitor ();
         break;
+    case FENCE_KDUMP_ACTION_VALIDATE:
+	error = 0;
+	break;
     default:
         break;
     }
diff --git a/agents/kdump/options.h b/agents/kdump/options.h
index 22731d7c..6d774e5a 100644
--- a/agents/kdump/options.h
+++ b/agents/kdump/options.h
@@ -36,6 +36,7 @@ enum {
     FENCE_KDUMP_ACTION_LIST     = 4,
     FENCE_KDUMP_ACTION_MONITOR  = 5,
     FENCE_KDUMP_ACTION_METADATA = 6,
+    FENCE_KDUMP_ACTION_VALIDATE = 7,
 };
 
 enum {
@@ -191,6 +192,8 @@ set_option_action (fence_kdump_opts_t *opts, const char *arg)
         opts->action = FENCE_KDUMP_ACTION_METADATA;
     } else if (!strcasecmp (arg, "monitor")) {
         opts->action = FENCE_KDUMP_ACTION_MONITOR;
+    } else if (!strcasecmp (arg, "validate-all")) {
+        opts->action = FENCE_KDUMP_ACTION_VALIDATE;
     } else {
         fprintf (stderr, "[error]: unsupported action '%s'\n", arg);
         exit (1);