Blame SOURCES/bz1608550-fence_dump-validate-all.patch

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