Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commi…
Commit: 664ccc6aa2fcd4b79459ca3083f8528969300a78
Parent: 8c11e2e4bf971ec75acf6cbc5b81c8efbaa273e3
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Nov 24 14:33:40 2011 +0100
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Dec 9 09:44:16 2011 +0100
fencing-agents: Add metadata output for fence agents in perl
Fencing agents written in PERL usually did not have option to print
XML metadata about its feature. Adding this feature also allow us
to generate manual pages directly from XML, so both GUI tools and manual
pages can see same feature.
Resolves: rhbz#714841 (partial)
---
fence/agents/baytech/Makefile.am | 3 +-
fence/agents/baytech/fence_baytech.8 | 84 --------------------------
fence/agents/baytech/fence_baytech.pl | 64 ++++++++++++++++++++-
fence/agents/brocade/Makefile.am | 3 +-
fence/agents/brocade/fence_brocade.8 | 84 --------------------------
fence/agents/brocade/fence_brocade.pl | 64 ++++++++++++++++++++-
fence/agents/bullpap/Makefile.am | 3 +-
fence/agents/bullpap/fence_bullpap.8 | 73 -----------------------
fence/agents/bullpap/fence_bullpap.pl | 68 ++++++++++++++++++++-
fence/agents/cpint/Makefile.am | 3 +-
fence/agents/cpint/fence_cpint.8 | 54 -----------------
fence/agents/cpint/fence_cpint.pl | 37 +++++++++++-
fence/agents/drac/Makefile.am | 3 +-
fence/agents/drac/fence_drac.8 | 105 ---------------------------------
fence/agents/drac/fence_drac.pl | 87 +++++++++++++++++++++++++++-
fence/agents/egenera/Makefile.am | 3 +-
fence/agents/egenera/fence_egenera.8 | 84 --------------------------
fence/agents/egenera/fence_egenera.pl | 61 +++++++++++++++++++
fence/agents/lib/fence2man.xsl | 4 +-
fence/agents/mcdata/Makefile.am | 3 +-
fence/agents/mcdata/fence_mcdata.8 | 84 --------------------------
fence/agents/mcdata/fence_mcdata.pl | 65 ++++++++++++++++++++-
fence/agents/vixel/Makefile.am | 3 +-
fence/agents/vixel/fence_vixel.8 | 72 ----------------------
fence/agents/vixel/fence_vixel.pl | 57 +++++++++++++++++-
fence/agents/xcat/Makefile.am | 3 +-
fence/agents/xcat/fence_xcat.8 | 63 --------------------
fence/agents/xcat/fence_xcat.pl | 56 ++++++++++++++++-
fence/agents/zvm/Makefile.am | 3 +-
fence/agents/zvm/fence_zvm.8 | 64 --------------------
fence/agents/zvm/fence_zvm.pl | 50 +++++++++++++++-
make/fencemanperl.mk | 7 ++
32 files changed, 625 insertions(+), 792 deletions(-)
diff --git a/fence/agents/baytech/Makefile.am b/fence/agents/baytech/Makefile.am
index 9ad50ec..5288efa 100644
--- a/fence/agents/baytech/Makefile.am
+++ b/fence/agents/baytech/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/baytech/fence_baytech.8 b/fence/agents/baytech/fence_baytech.8
deleted file mode 100644
index aa17955..0000000
--- a/fence/agents/baytech/fence_baytech.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_baytech 8
-
-.SH NAME
-fence_baytech - I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server
-
-.SH SYNOPSIS
-.B
-fence_baytech
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-
-This fencing agent is written for the Baytech RPC27-20nc in combination with
-a Cyclades terminal server. The Cyclades TS exports the RPC's serial port
-via a Telnet interface. Other interfaces, such as SSH, are possible.
-However, this script relies upon the assumption that Telnet is used. Future
-features to this agent would allow the agent to work with a multitude of
-different communication protocols such as Telnet, SSH or Kermit.
-
-The other assumption that is made is that Outlet names do not end in space.
-The name "Foo" and "Foo " are identical when the RPC prints them with
-the status command.
-
-fence_baytech accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_baytech
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.baytech.net
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIhost\fP
-IP address or hostname to connect to.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The name of the outlet to act upon.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_baytech.
-.TP
-\fIhost = < hostname | ip >\fR
-IP address or hostname to connect to.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIaction = < param >\fR
-The action required. This can be on, off, status or reboot (default)
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIoutlet = < param >\fR
-The name of the outlet to act upon.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/baytech/fence_baytech.pl b/fence/agents/baytech/fence_baytech.pl
index b625968..c978ec5 100644
--- a/fence/agents/baytech/fence_baytech.pl
+++ b/fence/agents/baytech/fence_baytech.pl
@@ -63,7 +63,7 @@ sub usage
print " -D debugging output\n";
print " -h usage\n";
print " -l string user name\n";
- print " -o string action: on,off,status or reboot (default)\n";
+ print " -o string action: on,off,status, reboot (default) or metadata\n";
print " -n string outlet name\n";
print " -p string password\n";
print " -S path script to run to retrieve password\n";
@@ -96,6 +96,64 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_baytech" shortdesc="I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server" >
+<longdesc>
+This fencing agent is written for the Baytech RPC27-20nc in combination with a Cyclades terminal server. The Cyclades TS exports the RPC\'s serial port via a Telnet interface. Other interfaces, such as SSH, are possible. However, this script relies upon the assumption that Telnet is used.
+
+The other assumption that is made is that Outlet names do not end in space. The name "Foo" and "Foo " are identical when the RPC prints them with the status command.
+</longdesc>
+<vendor-url>http://www.baytech.net</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
# Get operating paramters, either with getopts or from STDIN
sub get_options
{
@@ -108,6 +166,10 @@ sub get_options
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
} else {
get_options_stdin();
}
diff --git a/fence/agents/brocade/Makefile.am b/fence/agents/brocade/Makefile.am
index f4281ab..ed3394d 100644
--- a/fence/agents/brocade/Makefile.am
+++ b/fence/agents/brocade/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/brocade/fence_brocade.8 b/fence/agents/brocade/fence_brocade.8
deleted file mode 100644
index 812a3f9..0000000
--- a/fence/agents/brocade/fence_brocade.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_brocade 8
-
-.SH NAME
-fence_brocade - I/O Fencing agent for Brocade FC switches
-
-.SH SYNOPSIS
-.B
-fence_brocade
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_brocade is an I/O Fencing agent which can be used with Brocade FC
-switches. It logs into a Brocade switch via telnet and disables a specified
-port. Disabling the port which a machine is connected to effectively fences
-that machine. Lengthy telnet connections to the switch should be avoided
-while a GFS cluster is running because the connection will block any necessary
-fencing actions.
-
-fence_brocade accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_brocade
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the Brocade FC switch. When the fenced machine is ready to be brought back
-into the GFS cluster (after reboot) the port on the Brocade FC switch needs to
-be enabled. This can be done by running fence_brocade and specifying the
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_brocade.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/brocade/fence_brocade.pl b/fence/agents/brocade/fence_brocade.pl
index 933cecf..b6d3f45 100644
--- a/fence/agents/brocade/fence_brocade.pl
+++ b/fence/agents/brocade/fence_brocade.pl
@@ -40,7 +40,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -n <num> Port number to operate on\n";
- print " -o <string> Action: disable (default) or enable\n";
+ print " -o <string> Action: disable (default), enable or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
@@ -73,6 +73,63 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_brocade" shortdesc="Fence agent for Brocade over telnet" >
+<longdesc>
+fence_brocade is an I/O Fencing agent which can be used with Brocade FC switches. It logs into a Brocade switch via telnet and disables a specified port. Disabling the port which a machine is connected to effectively fences that machine. Lengthy telnet connections to the switch should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions.
+
+After a fence operation has taken place the fenced machine can no longer connect to the Brocade FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Brocade FC switch needs to be enabled. This can be done by running fence_brocade and specifying the enable action.
+</longdesc>
+<vendor-url>http://www.brocade.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
if (@ARGV > 0) {
getopts("a:hl:n:o:p:S:qV") || fail_usage ;
@@ -82,6 +139,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
if (defined $opt_S) {
$pwd_script_out = `$opt_S`;
chomp($pwd_script_out);
diff --git a/fence/agents/bullpap/Makefile.am b/fence/agents/bullpap/Makefile.am
index a708d4f..b454007 100644
--- a/fence/agents/bullpap/Makefile.am
+++ b/fence/agents/bullpap/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/bullpap/fence_bullpap.8 b/fence/agents/bullpap/fence_bullpap.8
deleted file mode 100644
index 1404c75..0000000
--- a/fence/agents/bullpap/fence_bullpap.8
+++ /dev/null
@@ -1,73 +0,0 @@
-.TH fence_bullpap 8
-
-.SH NAME
-fence_bullpap - I/O Fencing agent for Bull FAME architecture controlled by a
-PAP management console.
-
-.SH SYNOPSIS
-.B
-fence_bullpap
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_bullpap is an I/O Fencing agent which can be used with Bull's NovaScale
-machines controlled by PAP management consoles. This agent calls Bull's
-support software provided by the NSMasterHW RPM available from Bull.
-
-fence_bullpap accepts options on the command line as well as from stdin.
-fenced sends the options through stdin when it execs the agent. fence_bullpap
-can be run by itself with command line options which is useful for testing.
-
-Vendor URL: http://www.bull.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the PAP management console.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Login with administrative privileges.
-.TP
-\fB-d\fP \fIdomain\fP
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fB-o\fP \fIoption\fP
-Action to perform (on, off, reboot, status).
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet operation. Only print out error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the PAP management console.
-.TP
-\fIlogin= < param >\fR
-Login with administrative privileges.
-.TP
-\fIdomain = < param >\fR
-This is the domain name of the Bull machine to power-cycle.
-.TP
-\fIoption = < param >\fR
-Action to perform (on, off, reboot, status).
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/bullpap/fence_bullpap.pl b/fence/agents/bullpap/fence_bullpap.pl
index 6915f57..3309c18 100644
--- a/fence/agents/bullpap/fence_bullpap.pl
+++ b/fence/agents/bullpap/fence_bullpap.pl
@@ -20,8 +20,6 @@ my $pname = $_;
$action = "reboot"; # Default fence action
my $bulldir = "/usr/local/bull/NSMasterHW/bin";
-stat($bulldir);
-die "NSMasterHW not installed correctly" if ! -d _;
# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
# "#END_VERSION_GENERATION" It is generated by the Makefile
@@ -44,7 +42,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -d <domain> Domain to operate on\n";
- print " -o <string> Action: on, off, reboot (default) or status\n";
+ print " -o <string> Action: on, off, reboot (default), status or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
@@ -86,6 +84,62 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_bullpap" shortdesc="I/O Fencing agent for Bull FAME architecture controlled by a PAP management console." >
+<longdesc>
+fence_bullpap is an I/O Fencing agent which can be used with Bull\'s NovaScale machines controlled by PAP management consoles. This agent calls Bull\'s support software provided by the NSMasterHW RPM available from Bull.
+</longdesc>
+<vendor-url>http://www.bull.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="domain" unique="1" required="1">
+ <getopt mixed="-d <domain>" />
+ <content type="string" />
+ <shortdesc lang="en">Domain name of the Bull machine to power-cycle</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub get_options_stdin
{
my $opt;
@@ -224,6 +278,11 @@ if (@ARGV > 0)
usage if defined $opt_h;
version if defined $opt_V;
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
$host = $opt_a if defined $opt_a;
$login = $opt_l if defined $opt_l;
$passwd = $opt_p if defined $opt_p;
@@ -269,6 +328,9 @@ else
fail "failed: no password" unless defined $passwd;
}
+stat($bulldir);
+die "NSMasterHW not installed correctly" if ! -d _;
+
# convert $action to lower case
$_=$action;
if (/^on$/i) { $action = "on"; }
diff --git a/fence/agents/cpint/Makefile.am b/fence/agents/cpint/Makefile.am
index c02480a..e9fee26 100644
--- a/fence/agents/cpint/Makefile.am
+++ b/fence/agents/cpint/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/cpint/fence_cpint.8 b/fence/agents/cpint/fence_cpint.8
deleted file mode 100644
index e9f1c5d..0000000
--- a/fence/agents/cpint/fence_cpint.8
+++ /dev/null
@@ -1,54 +0,0 @@
-.TH fence_cpint 8
-
-.SH NAME
-fence_cpint - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_cpint
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a
-s390 or zSeries VM cluster.
-It uses the cpint package to send a CP LOGOFF command to the specified virtual
-machine.
-For fence_cpint to execute correctly, you must have the cpint module installed,
-and hcp in your PATH.
-\fBNOTE:\fP for fence_cpint to send a command to another virtual machine, the
-machine executing it must either be a privilege class C user or it must be
-the secondary user of the virtual machine to be fenced. This means that unless
-all of you GULM server nodes are privilege class C, fence_cpint can only be
-used with SLM.
-
-fence_cpint accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_cpint can be run by itself with command line options which is useful for
-testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_cpint.
-.TP
-\fIuserid = < parm >\fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/cpint/fence_cpint.pl b/fence/agents/cpint/fence_cpint.pl
index dc17eed..d3c016a 100644
--- a/fence/agents/cpint/fence_cpint.pl
+++ b/fence/agents/cpint/fence_cpint.pl
@@ -36,6 +36,7 @@ sub usage
print "\n";
print "Options:\n";
print " -h usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -u <string> userid of the virtual machine to fence\n";
print " -q quiet mode\n";
print " -V Version\n";
@@ -66,6 +67,35 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_cpint" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" >
+<longdesc>
+fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a s390 or zSeries VM cluster. It uses the cpint package to send a CP LOGOFF command to the specified virtual machine. For fence_cpint to execute correctly, you must have the cpint module installed, and hcp in your PATH.
+
+NOTE: for fence_cpint to send a command to another virtual machine, the machine executing it must either be a privilege class C user or it must be the secondary user of the virtual machine to be fenced. This means that unless all of you GULM server nodes are privilege class C, fence_cpint can only be used with SLM.
+</longdesc>
+<vendor-url>http://www.ibm.com</vendor-url>
+<parameters>
+ <parameter name="userid" unique="1" required="1">
+ <getopt mixed="-u <userid>" />
+ <content type="string" />
+ <shortdesc lang="en">Userid of the virtual machine to fence</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub get_options_stdin
{
my $opt;
@@ -121,12 +151,17 @@ sub get_options_stdin
}
if (@ARGV > 0){
- getopts("hqu:V") || fail_usage;
+ getopts("hqu:Vo:") || fail_usage;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-u' flag specified." unless defined $opt_u;
} else {
get_options_stdin();
diff --git a/fence/agents/drac/Makefile.am b/fence/agents/drac/Makefile.am
index 0a7de40..c9cdeda 100644
--- a/fence/agents/drac/Makefile.am
+++ b/fence/agents/drac/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/drac/fence_drac.8 b/fence/agents/drac/fence_drac.8
deleted file mode 100644
index 3660c5a..0000000
--- a/fence/agents/drac/fence_drac.8
+++ /dev/null
@@ -1,105 +0,0 @@
-.TH fence_drac 8
-
-.SH NAME
-fence_drac - fencing agent for Dell Remote Access Card
-
-.SH SYNOPSIS
-.B
-fence_drac
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_drac is an I/O Fencing agent which can be used with the Dell Remote
-Access Card (DRAC). This card provides remote access to controlling
-power to a server. It logs into the DRAC through the telnet interface of
-the card. By default, the telnet interface is not enabled. To enable the
-interface, you will need to use the racadm command in the racser-devel rpm
-available from Dell. To enable telnet on the DRAC:
-
-[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
-
-[root]# racadm racreset
-
-fence_drac accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_drac
-can be run by itself with command line options. This is useful for testing
-and for turning outlets on or off from scripts.
-
-Vendor URL: http://www.dell.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fR
-IP address or hostname of the switch.
-.TP
-\fB-c\fP \fIcmd_prompt\fR
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fB-d\fP \fIdracversion\fR
-Force fence_drac to treat the device as though it was for the specified drac version
-.TP
-\fB-D\fP \fIdumpfile\fR
-Debug file of the telnet interaction
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fR
-Login name.
-.TP
-\fB-m\fP \fImodulename\fR
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fB-o\fP \fIaction\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpassword\fR
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIcmd_prompt = < param >\fr
-Force fence_drac to use cmd_prompt as the command prompt
-.TP
-\fIdrac_version = < param >\fr
-Force fence_drac to treat the device as though it was for the specified drac version.
-.TP
-\fIdebug = < dumpfile >\fR
-Debug file of the telnet interaction
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fImodulename = < param >\fr
-The module name of the blade when using DRAC/MC firmware.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIdelay = < param >\fR
-Wait X seconds before fencing is started
-.TP
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/drac/fence_drac.pl b/fence/agents/drac/fence_drac.pl
index e28ed98..5e1b966 100644
--- a/fence/agents/drac/fence_drac.pl
+++ b/fence/agents/drac/fence_drac.pl
@@ -74,7 +74,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -m <modulename> DRAC/MC module name\n";
- print " -o <string> Action: reboot (default), off or on\n";
+ print " -o <string> Action: reboot (default), off, on or metadata\n";
print " -p <string> Login password\n";
print " -S <path> Script to run to retrieve password\n";
print " -f <seconds> Wait X seconds before fencing is started\n";
@@ -130,6 +130,86 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_drac" shortdesc="fencing agent for Dell Remote Access Card" >
+<longdesc>
+fence_drac is an I/O Fencing agent which can be used with the Dell Remote Access Card (DRAC). This card provides remote access to controlling power to a server. It logs into the DRAC through the telnet interface of the card. By default, the telnet interface is not enabled. To enable the interface, you will need to use the racadm command in the racser-devel rpm available from Dell. To enable telnet on the DRAC:
+
+[root]# racadm config -g cfgSerial -o cfgSerialTelnetEnable 1
+
+[root]# racadm racreset
+</longdesc>
+<vendor-url>http://www.dell.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="cmd_prompt" unique="1" required="0">
+ <getopt mixed="-c <prompt>" />
+ <content type="string" />
+ <shortdesc lang="en">Force fence_drac to use cmd_prompt as the command prompt</shortdesc>
+ </parameter>
+ <parameter name="drac_version" unique="1" required="0">
+ <getopt mixed="-d <version>" />
+ <content type="string" />
+ <shortdesc lang="en">Force fence_drac to treat the device as though it was for the specified drac version</shortdesc>
+ </parameter>
+ <parameter name="module_name" unique="1" required="0">
+ <getopt mixed="-m <modulename>" />
+ <content type="string"/>
+ <shortdesc lang="en">The module name of the blade when using DRAC/MC firmware.</shortdesc>
+ </parameter>
+ <parameter name="debug" unique="1" required="0">
+ <getopt mixed="-D <dumpfile>" />
+ <content type="string"/>
+ <shortdesc lang="en">Debug file of the telnet interaction</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="1" required="0">
+ <getopt mixed="-f <seconds>" />
+ <content type="string" default="0"/>
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub login
{
@@ -597,6 +677,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
$address = $opt_a;
diff --git a/fence/agents/egenera/Makefile.am b/fence/agents/egenera/Makefile.am
index 5cbb555..6cd82a6 100644
--- a/fence/agents/egenera/Makefile.am
+++ b/fence/agents/egenera/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/egenera/fence_egenera.8 b/fence/agents/egenera/fence_egenera.8
deleted file mode 100644
index 3823d7c..0000000
--- a/fence/agents/egenera/fence_egenera.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_egenera 8
-
-.SH NAME
-fence_egenera - I/O Fencing agent for the Egenera BladeFrame
-
-.SH SYNOPSIS
-.B
-fence_egenera
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_egenera is an I/O Fencing agent which can be used with the Egenera
-BladeFrame. It logs into a control blade (cserver) via ssh and operates
-on a processing blade (pserver) identified by the pserver name and the
-logical process area network (LPAN) that it is in. fence_egenera requires
-that ssh keys have been setup so that the fence_egenera does not require
-a password to authenticate. Refer to ssh(8) for more information on setting
-up ssh keys.
-
-fence_egenera accepts options on the command line as well as from stdin.
-Fenced sends parameters through stdin when it execs the agent. fence_egenera
-can also be run by itself with command line options.
-
-Vendor URL: http://www.egenera.com
-
-.SH OPTIONS
-.TP
-\fB-c\fP \fIcserver\fR
-The cserver to ssh to. cserver can be in the form user@hostname to
-specify a different user to login as.
-.TP
-\fB-u\fP \fIuser\fR
-Login name. Default login name is 'root'
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlpan\fR
-the lpan to operate on
-.TP
-\fB-o\fP \fIaction\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fB-p\fP \fIpserver\fR
-the pserver to operate on
-.TP
-\fB-f\fP \fIseconds\fR
-Wait X seconds before fencing is started
-.TP
-\fB-q\fP
-quite mode. suppress output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIaction = < param >\fR
-The action required. reboot (default), off, on or status.
-.TP
-\fIuser = < param >\fR
-Login name. Default login name is 'root'
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_apc.
-.TP
-\fIcserver = < param >\fR
-The cserver to ssh to. cserver can be in the form user@hostname to
-specify a different user to login as.
-.TP
-\fIlpan = < param >\fR
-The lpan to operate on
-.TP
-\fIpserver = < param >\fR
-The pserver to operate on
-.TP
-\fIesh = < param >\fR
-The path to the esh command on the cserver (default is /opt/panmgr/bin/esh)
-.TP
-\fIdelay = < param >\fR
-Wait X seconds before fencing is started
-
-.SH SEE ALSO
-fence(8), fence_node(8), ssh(8)
diff --git a/fence/agents/egenera/fence_egenera.pl b/fence/agents/egenera/fence_egenera.pl
index f09ff32..6270cee 100644
--- a/fence/agents/egenera/fence_egenera.pl
+++ b/fence/agents/egenera/fence_egenera.pl
@@ -74,6 +74,62 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_egenera" shortdesc="I/O Fencing agent for the Egenera BladeFrame" >
+<longdesc>
+fence_egenera is an I/O Fencing agent which can be used with the Egenera BladeFrame. It logs into a control blade (cserver) via ssh and operates on a process ing blade (pserver) identified by the pserver name and the logical process area network (LPAN) that it is in. fence_egenera requires that ssh keys have been setup so that the fence_egenera does not require a password to authenticate. Refer to ssh(8) for more information on setting up ssh keys.
+</longdesc>
+<vendor-url>http://www.bull.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="reboot" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="cserver" unique="1" required="1">
+ <getopt mixed="-c <cserver>" />
+ <content type="string" />
+ <shortdesc lang="en">The cserver to ssh to. cserver can be in the form user@hostname to specify a different user to login as.</shortdesc>
+ </parameter>
+ <parameter name="pserver" unique="1" required="1">
+ <getopt mixed="-p <pserver>" />
+ <content type="string" />
+ <shortdesc lang="en">The pserver to operate on.</shortdesc>
+ </parameter>
+ <parameter name="user" unique="1" required="1">
+ <getopt mixed="-u <name>" />
+ <content type="string" default="root" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="lpan" unique="1" required="1">
+ <getopt mixed="-l <lpan>" />
+ <content type="string" />
+ <shortdesc lang="en">The lpan to operate on.</shortdesc>
+ </parameter>
+ <parameter name="delay" unique="1" required="0">
+ <getopt mixed="-f <seconds>" />
+ <content type="string" default="0"/>
+ <shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="reboot" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
if (@ARGV > 0)
{
getopts("c:hl:o:p:u:qVf:") || fail_usage ;
@@ -83,6 +139,11 @@ if (@ARGV > 0)
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
$cserv = $opt_c if defined $opt_c;
$lpan = $opt_l if defined $opt_l;
$pserv = $opt_p if defined $opt_p;
diff --git a/fence/agents/lib/fence2man.xsl b/fence/agents/lib/fence2man.xsl
index 563b3a4..0fd71be 100644
--- a/fence/agents/lib/fence2man.xsl
+++ b/fence/agents/lib/fence2man.xsl
@@ -17,9 +17,11 @@
<xsl:choose>
<xsl:when test="@name = 'on'">Power on machine.</xsl:when>
<xsl:when test="@name = 'off'">Power off machine.</xsl:when>
+<xsl:when test="@name = 'enable'">Enable fabric access.</xsl:when>
+<xsl:when test="@name = 'disable'">Disable fabric access.</xsl:when>
<xsl:when test="@name = 'reboot'">Reboot machine.</xsl:when>
<xsl:when test="@name = 'monitor'">Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).</xsl:when>
-<xsl:when test="@name = 'meta-data'">Display the XML metadata describing this resource.</xsl:when>
+<xsl:when test="@name = 'metadata'">Display the XML metadata describing this resource.</xsl:when>
<xsl:when test="@name = 'list'">List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.</xsl:when>
<xsl:when test="@name = 'status'">This returns the status of the plug/virtual machine.</xsl:when>
<!-- Ehhh -->
diff --git a/fence/agents/mcdata/Makefile.am b/fence/agents/mcdata/Makefile.am
index f9953f5..f1a5939 100644
--- a/fence/agents/mcdata/Makefile.am
+++ b/fence/agents/mcdata/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/mcdata/fence_mcdata.8 b/fence/agents/mcdata/fence_mcdata.8
deleted file mode 100644
index c52ffd6..0000000
--- a/fence/agents/mcdata/fence_mcdata.8
+++ /dev/null
@@ -1,84 +0,0 @@
-.TH fence_mcdata 8
-
-.SH NAME
-fence_mcdata - I/O Fencing agent for McData FC switches
-
-.SH SYNOPSIS
-.B
-fence_mcdata
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_mcdata is an I/O Fencing agent which can be used with McData FC
-switches. It logs into a McData switch via telnet and disables a specified
-port. Disabling the port which a machine is connected to effectively fences
-that machine. Lengthy telnet connections to the switch should be avoided
-while a GFS cluster is running because the connection will block any necessary
-fencing actions.
-
-fence_mcdata accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_mcdata
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer connect
-to the McData FC switch. When the fenced machine is ready to be brought back
-into the GFS cluster (after reboot) the port on the McData FC switch needs to
-be enabled. This can be done by running fence_mcdata and specifying the
-enable action.
-
-Vendor URL: http://www.brocade.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-l\fP \fIlogin\fP
-Username name for the switch.
-.TP
-\fB-n\fP \fIport\fP
-The port number to disable on the switch.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. disable (default) or enable.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_mcdata.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIlogin = < param >\fR
-Login name.
-.TP
-\fIoption = < param >\fR
-The action required. disable (default) or enable.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to disable on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/mcdata/fence_mcdata.pl b/fence/agents/mcdata/fence_mcdata.pl
index 7a01d1d..a469a1c 100644
--- a/fence/agents/mcdata/fence_mcdata.pl
+++ b/fence/agents/mcdata/fence_mcdata.pl
@@ -46,7 +46,7 @@ sub usage
print " -h usage\n";
print " -l <name> Login name\n";
print " -n <num> Port number to disable\n";
- print " -o <string> Action: disable (default) or enable\n";
+ print " -o <string> Action: disable (default), enable or metadata\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve login password\n";
print " -q quiet mode\n";
@@ -79,6 +79,64 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_mcdata" shortdesc="I/O Fencing agent for McData FC switches" >
+<longdesc>
+fence_mcdata is an I/O Fencing agent which can be used with McData FC switches. It logs into a McData switch via telnet and disables a specified port. Disabling the port which a machine is connected to effectively fences that machine. Lengthy telnet connections to the switch should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions.
+
+After a fence operation has taken place the fenced machine can no longer connect to the McData FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the McData FC switch needs to be enabled. This can be done by running fence_mcdata and specifying the enable action.
+</longdesc>
+<vendor-url>http://www.brocade.com</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="disable" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="login" unique="1" required="1">
+ <getopt mixed="-l <name>" />
+ <content type="string" />
+ <shortdesc lang="en">Login Name</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="enable" />
+ <action name="disable" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
sub get_options_stdin
{
my $opt;
@@ -153,6 +211,11 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
fail_usage "No '-n' flag specified." unless defined $opt_n;
fail_usage "No '-l' flag specified." unless defined $opt_l;
diff --git a/fence/agents/vixel/Makefile.am b/fence/agents/vixel/Makefile.am
index f3e1339..64d6010 100644
--- a/fence/agents/vixel/Makefile.am
+++ b/fence/agents/vixel/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/vixel/fence_vixel.8 b/fence/agents/vixel/fence_vixel.8
deleted file mode 100644
index 83db14f..0000000
--- a/fence/agents/vixel/fence_vixel.8
+++ /dev/null
@@ -1,72 +0,0 @@
-.TH fence_vixel 8
-
-.SH NAME
-fence_vixel - I/O Fencing agent for Vixel FC switches
-
-.SH SYNOPSIS
-.B
-fence_vixel
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches.
-It logs into a Vixel switch via telnet and removes the specified port from the
-zone. Removing the zone access from the port disables the port from being able
-to access the storage.
-
-fence_vixel accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_vixel
-can be run by itself with command line options which is useful for testing.
-
-After a fence operation has taken place the fenced machine can no longer
-connect to the Vixel FC switch. When the fenced machine is ready to be brought
-back into the GFS cluster (after reboot) the port on the Vixel FC switch needs
-to be enabled. In order to do this, log into the Vixel FC switch. Then go to:
-
-config->zones->config <port> <comma-separated-list-of-ports-in-the-zone>
-
-Then apply
-
-Consult the Vixel manual for details
-
-Vendor URL: http://www.emulex.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address of the switch.
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fIport\fP
-The port number to remove zoning from on the switch.
-.TP
-\fB-p\fP \fIpassword\fP
-Password for login.
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password for login.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_vixel.
-.TP
-\fIipaddr = < hostname | ip >\fR
-IP address or hostname of the switch.
-.TP
-\fIpasswd = < param >\fR
-Password for login.
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password for login.
-.TP
-\fIport = < param >\fR
-The port number to remove zoning from on the switch.
-
-.SH SEE ALSO
-fence(8), fence_node(8)
diff --git a/fence/agents/vixel/fence_vixel.pl b/fence/agents/vixel/fence_vixel.pl
index 470d4c7..59b9ff0 100644
--- a/fence/agents/vixel/fence_vixel.pl
+++ b/fence/agents/vixel/fence_vixel.pl
@@ -34,6 +34,7 @@ sub usage
print "Options:\n";
print " -a <ip> IP address or hostname of switch\n";
print " -h Usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -n <num> Port number to disable\n";
print " -p <string> Password for login\n";
print " -S <path> Script to run to retrieve login password\n";
@@ -66,14 +67,68 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_vixel" shortdesc="I/O Fencing agent for Vixel FC switches" >
+<longdesc>
+fence_vixel is an I/O Fencing agent which can be used with Vixel FC switches. It logs into a Vixel switch via telnet and removes the specified port from the zone. Removing the zone access from the port disables the port from being able to access the storage.
+
+After a fence operation has taken place the fenced machine can no longer connect to the Vixel FC switch. When the fenced machine is ready to be brought back into the GFS cluster (after reboot) the port on the Vixel FC switch needs to be enabled. In order to do this, log into the Vixel FC switch. Then go to:
+
+config->zones->config <port> <comma-separated-list-of-ports-in-the-zone>
+
+Then apply. Consult the Vixel manual for details.
+</longdesc>
+<vendor-url>http://www.emulex.com</vendor-url>
+<parameters>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="port" unique="1" required="1">
+ <getopt mixed="-n <id>" />
+ <content type="string" />
+ <shortdesc lang="en">Physical plug number or name of virtual machine</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
if (@ARGV > 0) {
- getopts("a:hn:p:S:V") || fail_usage ;
+ getopts("a:hn:p:S:Vo:") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
if (defined $opt_S) {
diff --git a/fence/agents/xcat/Makefile.am b/fence/agents/xcat/Makefile.am
index de54526..27c289c 100644
--- a/fence/agents/xcat/Makefile.am
+++ b/fence/agents/xcat/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/xcat/fence_xcat.8 b/fence/agents/xcat/fence_xcat.8
deleted file mode 100644
index 719f896..0000000
--- a/fence/agents/xcat/fence_xcat.8
+++ /dev/null
@@ -1,63 +0,0 @@
-.TH fence_xcat 8
-
-.SH NAME
-fence_xcat - I/O Fencing agent for xcat environments
-
-.SH SYNOPSIS
-.B
-fence_xcat
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_xcat is a wrapper to the rpower(1) command that is distributed
-with the xCAT project available at http://www.xcat.org. Use of
-fence_xcat requires that xcat has already been properly configured
-for your environment. Refer to xCAT(1) for more information on
-configuring xCAT.
-
-fence_xcat accepts options on the command line as well as from stdin.
-fenced sends parameters through stdin when it execs the agent. fence_xcat
-can be run by itself with command line options which is useful for testing.
-
-NOTE: It is recommended that fence_bladecenter(8) is used instead of fence_xcat if
-the bladecenter firmware supports telnet. This interface is much cleaner and
-easier to setup.
-
-Vendor URL: http://www.xcat.org
-
-.SH OPTIONS
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-n\fP \fInodename\fP
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fB-o\fP \fIaction\fP
-The action required. on, off, reset (default) or stat.
-.TP
-\fB-r\fP \fIrpower\fP
-The path to the rpower binary.
-.TP
-\fB-q\fP
-Quiet mode: print only error messages.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fR
-This option is used by fence_node(8) and is ignored by fence_xcat.
-.TP
-\fInodename = < param >\fR
-The nodename as defined in nodelist.tab of the xCAT setup.
-.TP
-\fIaction = < param >\fR
-The action required. on, off, reset (default) or stat.
-.TP
-\fIrpower = < param >\fR
-The path to the rpower binary.
-
-.SH SEE ALSO
-fence(8), fence_node(8), fence_bladecenter(8), nodelist.tab(8), rpower(1), xCAT(1)
diff --git a/fence/agents/xcat/fence_xcat.pl b/fence/agents/xcat/fence_xcat.pl
index 2d8166a..f984ec1 100644
--- a/fence/agents/xcat/fence_xcat.pl
+++ b/fence/agents/xcat/fence_xcat.pl
@@ -38,7 +38,7 @@ sub usage
print "Options:\n";
print " -h usage\n";
print " -n <name> nodename\n";
- print " -o <string> Action: on | off | reset (default) | stat\n";
+ print " -o <string> Action: on, off, reset (default), status or metadata\n";
print " -r <rpower> rpower command\n";
print " -q quiet mode\n";
print " -V version\n";
@@ -70,6 +70,49 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_xcat" shortdesc="I/O Fencing agent for xcat environments" >
+<longdesc>
+fence_xcat is a wrapper to the rpower(1) command that is distributed with the xCAT project available at http://www.xcat.org. Use of fence_xcat requires that xcat has already been properly configured for your environment. Refer to xCAT(1) for more information on configuring xCAT.
+
+NOTE: It is recommended that fence_bladecenter(8) is used instead of fence_xcat if the bladecenter firmware supports telnet. This interface is much cleaner and easier to setup.
+</longdesc>
+<vendor-url>http://www.xcat.org</vendor-url>
+<parameters>
+ <parameter name="action" unique="1" required="1">
+ <getopt mixed="-o <action>" />
+ <content type="string" default="restart" />
+ <shortdesc lang="en">Fencing Action</shortdesc>
+ </parameter>
+ <parameter name="nodename" unique="1" required="1">
+ <getopt mixed="-n <nodename>" />
+ <content type="string" />
+ <shortdesc lang="en">The nodename as defined in nodelist.tab of the xCAT setup.</shortdesc>
+ </parameter>
+ <parameter name="rpower" unique="1" required="0">
+ <getopt mixed="-r <rpower>" />
+ <content type="string" />
+ <shortdesc lang="en">The path to the rpower binary.</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="on" />
+ <action name="off" />
+ <action name="status" />
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
+
sub get_options_stdin
{
my $opt;
@@ -128,10 +171,15 @@ if (@ARGV > 0) {
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-n' flag specified." unless defined $opt_n;
$opt_o=lc($opt_o);
fail_usage "Unrecognised action '$opt_o' for '-o' flag"
- unless $opt_o =~ /^(on|off|reset|stat)$/;
+ unless $opt_o =~ /^(on|off|reset|stat|status)$/;
} else {
get_options_stdin();
@@ -139,7 +187,7 @@ if (@ARGV > 0) {
fail "failed: no plug number" unless defined $opt_n;
$opt_o=lc($opt_o);
fail "failed: unrecognised action: $opt_o"
- unless $opt_o =~ /^(on|off|reset|stat)$/;
+ unless $opt_o =~ /^(on|off|reset|stat|status)$/;
}
pipe (RDR,WTR);
@@ -173,7 +221,7 @@ while (<RDR>)
{
$status = $2;
- if (($opt_o eq $2) || ($opt_o eq "stat"))
+ if (($opt_o eq $2) || ($opt_o =~ /stat/i) || ($opt_o =~ /status/i))
{
$found=1;
last;
diff --git a/fence/agents/zvm/Makefile.am b/fence/agents/zvm/Makefile.am
index a75cf66..3ce3d82 100644
--- a/fence/agents/zvm/Makefile.am
+++ b/fence/agents/zvm/Makefile.am
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET)
dist_man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk
+include $(top_srcdir)/make/fencemanperl.mk
-clean-local:
+clean-local: clean-man
rm -f $(TARGET)
diff --git a/fence/agents/zvm/fence_zvm.8 b/fence/agents/zvm/fence_zvm.8
deleted file mode 100644
index c58d8ae..0000000
--- a/fence/agents/zvm/fence_zvm.8
+++ /dev/null
@@ -1,64 +0,0 @@
-.TH fence_zvm 8
-
-.SH NAME
-fence_zvm - I/O Fencing agent for GFS on s390 and zSeries VM clusters
-
-.SH SYNOPSIS
-.B
-fence_zvm
-[\fIOPTION\fR]...
-
-.SH DESCRIPTION
-fence_zvm is an I/O Fencing agent used on a GFS virtual machine in a s390 or zSeries VM cluster.
-It uses the s3270 program to log the specified virtual machine out of VM.
-For fence_zvm to execute correctly, you must have s3270 in your PATH.
-
-fence_zvm accepts options on the command line as well as from stdin.
-fence_node sends the options through stdin when it execs the agent.
-fence_zvm can be run by itself with command line options which is useful
-for testing.
-
-Vendor URL: http://www.ibm.com
-
-.SH OPTIONS
-.TP
-\fB-a\fP \fIIPaddress\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fB-h\fP
-Print out a help message describing available options, then exit.
-.TP
-\fB-u\fP \fIuserid\fP
-userid of the virtual machine to fence (required).
-.TP
-\fB-p\fP \fIpassword\fP
-password of the virtual machine to fence (required).
-.TP
-\fB-S\fP \fIpath\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fB-q\fP
-quiet mode, no output.
-.TP
-\fB-V\fP
-Print out a version message, then exit.
-
-.SH STDIN PARAMETERS
-.TP
-\fIagent = < param >\fP
-This option is used by fence_node(8) and is ignored by fence_zvm.
-.TP
-\fIipaddr = < hostname | ip >\fP
-IP address or hostname of the Physical machine (required).
-.TP
-\fIpasswd = < param >\fP
-password of the virtual machine to fence (required).
-.TP
-\fIpasswd_script = < param >\fR
-Full path to an executable to generate the password of the virtual machine to fence.
-.TP
-\fIuserid = < param >\fP
-userid of the virtual machine to fence (required).
-
-.SH SEE ALSO
-fence(8), fenced(8), fence_node(8)
diff --git a/fence/agents/zvm/fence_zvm.pl b/fence/agents/zvm/fence_zvm.pl
index f90125a..e6386e4 100644
--- a/fence/agents/zvm/fence_zvm.pl
+++ b/fence/agents/zvm/fence_zvm.pl
@@ -40,6 +40,7 @@ sub usage
print "Options:\n";
print " -a <ip> IP address or hostname of the physical s390\n";
print " -h usage\n";
+ print " -o metadata print XML metadata for fence agent\n";
print " -u <string> userid of the virtual machine to fence\n";
print " -p <string> Password\n";
print " -S <path> Script to run to retrieve login password\n";
@@ -73,6 +74,48 @@ sub version
exit 0;
}
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_zvm" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" >
+<longdesc>
+fence_zvm is an I/O Fencing agent used on a GFS virtual machine in a s390 or zSeries VM cluster. It uses the s3270 program to log the specified virtual machine out of VM. For fence_zvm to execute correctly, you must have s3270 in your PATH.
+</longdesc>
+<vendor-url>http://www.ibm.com</vendor-url>
+<parameters>
+ <parameter name="ipaddr" unique="1" required="1">
+ <getopt mixed="-a <ip>" />
+ <content type="string" />
+ <shortdesc lang="en">IP Address or Hostname</shortdesc>
+ </parameter>
+ <parameter name="userid" unique="1" required="1">
+ <getopt mixed="-u <userid>" />
+ <content type="string" />
+ <shortdesc lang="en">Userid of the virtual machine to fence</shortdesc>
+ </parameter>
+ <parameter name="passwd" unique="1" required="0">
+ <getopt mixed="-p <password>" />
+ <content type="string" />
+ <shortdesc lang="en">Login password or passphrase</shortdesc>
+ </parameter>
+ <parameter name="passwd_script" unique="1" required="0">
+ <getopt mixed="-S <script>" />
+ <content type="string" />
+ <shortdesc lang="en">Script to retrieve password</shortdesc>
+ </parameter>
+ <parameter name="help" unique="1" required="0">
+ <getopt mixed="-h" />
+ <content type="string" />
+ <shortdesc lang="en">Display help and exit</shortdesc>
+ </parameter>
+</parameters>
+<actions>
+ <action name="metadata" />
+</actions>
+</resource-agent>
+';
+}
+
sub do_read
{
@@ -282,12 +325,17 @@ sub get_options_stdin
}
if (@ARGV > 0){
- getopts("a:hp:S:qr:u:V") || fail_usage;
+ getopts("a:hp:S:qr:u:Vo:") || fail_usage;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unkown parameter." if (@ARGV > 0);
+ if ((defined $opt_o) && ($opt_o =~ /metadata/i)) {
+ print_metadata();
+ exit 0;
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
if (defined $opt_S) {
diff --git a/make/fencemanperl.mk b/make/fencemanperl.mk
new file mode 100644
index 0000000..74c1508
--- /dev/null
+++ b/make/fencemanperl.mk
@@ -0,0 +1,7 @@
+%.8: $(TARGET) $(top_srcdir)/fence/agents/lib/fence2man.xsl
+ set -e && \
+ perl $(TARGET) -o metadata > .$@.tmp && \
+ xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl .$@.tmp > $@
+
+clean-man:
+ rm -f *.8 .*.8.tmp
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=30…
Commit: 30f9e21706028056af6bc65555783d794a71c07f
Parent: 0f070b75b0864ed4b46c361916f822b4a57a1a3f
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Oct 5 00:18:17 2011 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Dec 6 14:42:18 2011 +0000
libgfs2: Don't count sentinel dirent as an entry
dir_split_leaf() adds a sentinel dirent using dirent_alloc() which
increments di_entries in the directory dinode. Since sentinel dirents
aren't real directory entries, di_entries becomes too high in some
situations. This patch decrements di_entries after the sentinel dirent
is created to fix the discrepancy.
rhbz#745126
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/fs_ops.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index e2b4f54..6579d6f 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -926,6 +926,8 @@ static void dir_split_leaf(struct gfs2_inode *dip, uint32_t lindex,
if (dirent_alloc(dip, nbh, 0, &new))
die("dir_split_leaf (4)\n");
new->de_inum.no_formal_ino = 0;
+ /* Don't count the sentinel dirent as an entry */
+ dip->i_di.di_entries--;
}
oleaf->lf_depth = be16_to_cpu(oleaf->lf_depth) + 1;
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 91f331d094994cd33abcdca84e7e2989f44170fe
Parent: 3a18369266fdaf9fa2e68824da77a2886c6a3b63
Author: Carlos Maiolino <cmaiolino(a)redhat.com>
AuthorDate: Wed Dec 7 09:08:03 2011 -0200
Committer: Carlos Maiolino <cmaiolino(a)redhat.com>
CommitterDate: Wed Dec 7 09:08:03 2011 -0200
fsck: Merge strings
This patch just change some log_error calls in a way the strings can be merged
during the i18n translations, removing the amount of duplicated work to translators.
---
gfs2/fsck/fs_recovery.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 8c3062b..1d9f632 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -456,9 +456,8 @@ static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen,
error = gfs2_find_jhead(ip, &head);
if (error) {
if (opts.no) {
- log_err( _("Journal #%d (\"journal%d\") is corrupt.\n"
- "Not fixing it due to the -n option.\n"),
- j+1, j);
+ log_err( _("Journal #%d (\"journal%d\") is corrupt\n"),j+1, j);
+ log_err( _("Not fixing it due to the -n option.\n"));
goto out;
}
if (!preen_is_safe(sdp, preen, force_check)) {
@@ -501,13 +500,12 @@ static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen,
return 0;
}
if (opts.no) {
- log_err(_("Journal #%d (\"journal%d\") is dirty; not replaying"
- " due to the -n option.\n"),
- j+1, j);
+ log_err(_("Journal #%d (\"journal%d\") is dirty\n"),j+1, j);
+ log_err(_("not replaying due to the -n option.\n"));
goto out;
}
if (!preen_is_safe(sdp, preen, force_check)) {
- log_err( _("Journal #%d (\"journal%d\") is dirty.\n"), j+1, j);
+ log_err( _("Journal #%d (\"journal%d\") is dirty\n"), j+1, j);
log_err( _("I'm not replaying it because it may be unsafe:\n"
"Locking protocol is not lock_nolock and "
"the -a or -p option was specified.\n"));
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=45…
Commit: 45d47966803f073a910521716372b32541419db9
Parent: 0000000000000000000000000000000000000000
Author: Digital Mermaid <digimer(a)lework.alteeve.com>
AuthorDate: 2011-12-07 04:12 +0000
Committer: Digital Mermaid <digimer(a)lework.alteeve.com>
CommitterDate: 2011-12-07 04:12 +0000
annotated tag: cluster-3.1.8 has been created
at 45d47966803f073a910521716372b32541419db9 (tag)
tagging 9be00f89c9b3d9670cbd73525d4c41440a37b08a (commit)
replaces cluster-3.1.7
cluster-3.1.8 release
Adam Drew (1):
rgmanager: Fix dependency restart bug in CP mode
David Teigland (2):
fenced: full check for member changes
dlm_controld: full check for member changes
Digital Mermaid (1):
Changes the kernel version check to handle 3.x.y kernels. Now if
Fabio M. Di Nitto (4):
config: make altname validation position indipendent
qdiskd: fix memcpy direction and possible memory leak
config: filterout fence_pcmk from metadata generation
config: drastically improve cman RRP configuration handling
Lon Hohberger (7):
rgmanager: Fix dependency restart bug
qdisk: Fix man page example
rgmanager: Fix dependency restart bug in CP mode
rgmanager: Clean up DBus concurrency
rgmanager: Block signals when dealing with dbus
Revert "rgmanager: Fix dependency restart bug in CP mode"
rgmanager: Send events on service stop & preserve frozen flag
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9b…
Commit: 9be00f89c9b3d9670cbd73525d4c41440a37b08a
Parent: 991bfb0b1f547da5314141fcd79e0ea2253f78f4
Author: Digital Mermaid <digimer(a)lework.alteeve.com>
AuthorDate: Sat Dec 3 12:53:15 2011 -0500
Committer: Digital Mermaid <digimer(a)lework.alteeve.com>
CommitterDate: Sat Dec 3 12:53:15 2011 -0500
Changes the kernel version check to handle 3.x.y kernels. Now if the 'x' version of the running kernel is higher than the 'x' version of the minimum kernel, the test passes. Also changed the method of checking that version numbers were gathered so that a version number of '0' would be seen as valid.
Signed-off-by: Digital Mermaid <digimer(a)lework.alteeve.com>
---
configure | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 9c7a773..4e9bc2a 100755
--- a/configure
+++ b/configure
@@ -254,13 +254,14 @@ sub kernel_version {
}
close MAKEFILE;
# Warn and continue if kernel version was not found
- if (!$build_version || !$build_patchlevel || !$build_sublevel) {
+ if (not defined $build_version || not defined $build_patchlevel || not defined $build_sublevel) {
print " WARNING: Could not determine kernel version.\n";
print " Build might fail!\n";
return 1;
}
# checking VERSION, PATCHLEVEL and SUBLEVEL for the supplied kernel
- if ($build_version >= $version[0] &&
+ if (($build_version > $version[0]) ||
+ $build_version == $version[0] &&
$build_patchlevel >= $version[1] &&
$build_sublevel >= $version[2]) {
print " Current kernel version appears to be OK\n";
Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdif…
Commit: 3a18369266fdaf9fa2e68824da77a2886c6a3b63
Parent: d427382d1a9fe110357e886d99d02f639593641d
Author: Steven Whitehouse <swhiteho(a)redhat.com>
AuthorDate: Thu Dec 1 14:23:26 2011 +0000
Committer: Steven Whitehouse <swhiteho(a)redhat.com>
CommitterDate: Thu Dec 1 14:23:26 2011 +0000
libgfs2: More unused bits (re)moved
Some headers and constants which are not required are removed
and, one set of of constants which is only used internally to
a single file in the library are moved to that file.
Signed-off-by: Steven Whitehouse <swhiteho(a)redhat.com>
---
gfs2/libgfs2/fs_ops.c | 4 ++++
gfs2/libgfs2/libgfs2.h | 11 -----------
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index fe7fce6..e2e64d6 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -14,6 +14,10 @@
#include <linux/types.h>
#include "libgfs2.h"
+#define DATA (1)
+#define META (2)
+#define DINODE (3)
+
static __inline__ uint64_t *metapointer(struct gfs2_buffer_head *bh,
unsigned int height,
struct metapath *mp)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index c8230d6..ef11221 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -6,9 +6,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/types.h>
@@ -143,10 +140,6 @@ struct gfs2_inode {
struct gfs2_sbd *i_sbd;
};
-#define BUF_HASH_SHIFT (13) /* # hash buckets = 8K */
-#define BUF_HASH_SIZE (1 << BUF_HASH_SHIFT)
-#define BUF_HASH_MASK (BUF_HASH_SIZE - 1)
-
/* FIXME not sure that i want to keep a record of the inodes or the
* contents of them, or both ... if I need to write back to them, it
* would be easier to hold the inode as well */
@@ -275,10 +268,6 @@ struct metapath {
/* Look at this! Why can't we go bigger than 2GB? */
#define GFS2_MAX_RGSIZE (2048)
-#define DATA (1)
-#define META (2)
-#define DINODE (3)
-
/* bitmap.c */
struct gfs2_bmap {
uint64_t size;
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=99…
Commit: 991bfb0b1f547da5314141fcd79e0ea2253f78f4
Parent: 8285548a5fcab7b3cb3e6631d782816dd4f134cf
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Wed Nov 30 12:57:30 2011 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Wed Nov 30 12:57:30 2011 +0100
config: drastically improve cman RRP configuration handling
- don't allow configuration of more than 2 rings
- allow overrided of alternate mcast address and port via
envars
- when using broadcast, set different ports on second ring.
this also required a substantial change in transport handling
- add support for
<cman>
<multicast addr= port= ttl=/>
<altmulticast addr= port= ttl=/>
</cman>
- don't allow overlap of addresses/ports
- remove redundant port settings in cman
- change relaxng schema to reflect above changes
Resolves: rhbz#733298
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/daemon/cman-preconfig.c | 217 +++++++++++++++++++++-------------
config/tools/xml/cluster.rng.in.head | 64 +++++++---
2 files changed, 182 insertions(+), 99 deletions(-)
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index fb534a9..0ced1bb 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -50,14 +50,19 @@ static char nodename[MAX_CLUSTER_MEMBER_NAME_LEN];
static int nodeid;
static int two_node;
static unsigned int disable_openais;
-static unsigned int portnum;
static int num_nodenames;
static char *key_filename=NULL;
-static char *mcast_name;
static char *cluster_name;
static char error_reason[1024] = { '\0' };
static hdb_handle_t cluster_parent_handle;
static int use_hashed_cluster_id = 0;
+static unsigned int portnum = 0;
+static unsigned int altportnum = 0;
+static char *mcast_name = NULL;
+static char *altmcast_name = NULL;
+static unsigned int ttl = 1;
+static unsigned int altttl = 1;
+
/*
* Exports the interface for the service
@@ -279,7 +284,7 @@ static int add_udpu_members(struct objdb_iface_ver0 *objdb, hdb_handle_t interfa
#define PRIMARY_IFACE 0
#define ALT_IFACE 1
-static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr, int port, int ttl, int altiface, enum tx_mech transport)
+static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr, int port, int intttl, int altiface, enum tx_mech transport)
{
hdb_handle_t totem_object_handle;
hdb_handle_t find_handle;
@@ -295,6 +300,11 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr,
[TX_MECH_RDMA] = "iba",
};
+ if (num_interfaces >= 2) {
+ snprintf(error_reason, sizeof(error_reason) - 1, "Configuration of more than 2 rings is not supported");
+ return -1;
+ }
+
/* Check the families match */
if (address_family(mcast, &mcast_addr, 0) !=
address_family(ifaddr, &if_addr, mcast_addr.ss_family)) {
@@ -364,14 +374,14 @@ static int add_ifaddr(struct objdb_iface_ver0 *objdb, char *mcast, char *ifaddr,
tmp, strlen(tmp)+1, OBJDB_VALUETYPE_STRING);
/* paranoia check. corosync already does it */
- if ((ttl < 0) || (ttl > 255)) {
- sprintf(error_reason, "TTL value (%u) out of range (0 - 255)", ttl);
+ if ((intttl < 0) || (intttl > 255)) {
+ sprintf(error_reason, "TTL value (%u) out of range (0 - 255)", intttl);
return -1;
}
/* add the key to the objdb only if value is not default */
- if (ttl != 1) {
- sprintf(tmp, "%d", ttl);
+ if (intttl != 1) {
+ sprintf(tmp, "%d", intttl);
objdb->object_key_create_typed(interface_object_handle, "ttl",
tmp, strlen(tmp)+1, OBJDB_VALUETYPE_STRING);
}
@@ -418,11 +428,11 @@ static char *default_mcast(char *node, int altiface)
if (family == AF_INET) {
snprintf(addr, sizeof(addr), "239.192.%d.%d", clusterid >> 8, clusterid % 0xFF);
- return addr;
+ return strdup(addr);
}
if (family == AF_INET6) {
snprintf(addr, sizeof(addr), "ff15::%x", clusterid);
- return addr;
+ return strdup(addr);
}
return NULL;
@@ -568,6 +578,11 @@ static int get_env_overrides(void)
portnum = atoi(getenv("CMAN_IP_PORT"));
}
+ /* optional alternate port */
+ if (getenv("CMAN_IP_ALTPORT")) {
+ altportnum = atoi(getenv("CMAN_IP_ALTPORT"));
+ }
+
/* optional security key filename */
if (getenv("CMAN_KEYFILE")) {
key_filename = strdup(getenv("CMAN_KEYFILE"));
@@ -591,6 +606,10 @@ static int get_env_overrides(void)
mcast_name = getenv("CMAN_MCAST_ADDR");
}
+ if (getenv("CMAN_ALTMCAST_ADDR")) {
+ altmcast_name = getenv("CMAN_ALTMCAST_ADDR");
+ }
+
if (getenv("CMAN_2NODE")) {
two_node = 1;
expected_votes = 1;
@@ -612,11 +631,15 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
hdb_handle_t object_handle;
hdb_handle_t find_handle;
hdb_handle_t node_object_handle;
+ hdb_handle_t mcast_handle;
hdb_handle_t alt_object;
enum tx_mech transport = TX_MECH_UDP;
char *str;
int error;
- unsigned int ttl = 1;
+ unsigned int mcast_portnum = DEFAULT_PORT;
+ unsigned int altmcast_portnum = DEFAULT_PORT;
+ char *altmcast_name_tmp = NULL;
+ int broadcast = 0;
if (!getenv("CMAN_NOCONFIG")) {
/* our nodename */
@@ -665,7 +688,7 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
}
/* Add <cman> bits to pass down to the main module*/
- if ( (node_object_handle = nodelist_byname(objdb, cluster_parent_handle, nodename))) {
+ if ((node_object_handle = nodelist_byname(objdb, cluster_parent_handle, nodename))) {
if (objdb_get_string(objdb, node_object_handle, "nodeid", &nodeid_str)) {
sprintf(error_reason, "This node has no nodeid in cluster.conf");
write_cman_pipe("This node has no nodeid in cluster.conf");
@@ -674,85 +697,103 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
}
objdb->object_find_create(cluster_parent_handle, "cman", strlen("cman"), &find_handle);
-
- if (objdb->object_find_next(find_handle, &object_handle) == 0) {
-
- hdb_handle_t mcast_handle;
- hdb_handle_t find_handle2;
-
- if (!mcast_name) {
-
- objdb->object_find_create(object_handle, "multicast", strlen("multicast"), &find_handle2);
- if (objdb->object_find_next(find_handle2, &mcast_handle) == 0) {
-
- objdb_get_string(objdb, mcast_handle, "addr", &mcast_name);
- objdb_get_int(objdb, mcast_handle, "ttl", &ttl, ttl);
- }
- objdb->object_find_destroy(find_handle2);
- }
-
- if (!mcast_name) {
- mcast_name = default_mcast(nodename, PRIMARY_IFACE);
-
- }
- if (!mcast_name)
- return -1;
-
- /* See if the user wants our default set of openais services (default=yes) */
- objdb_get_int(objdb, object_handle, "disable_openais", &disable_openais, 0);
-
- objdb->object_key_create_typed(object_handle, "nodename",
- nodename, strlen(nodename)+1, OBJDB_VALUETYPE_STRING);
+ if (objdb->object_find_next(find_handle, &object_handle)) {
+ sprintf(error_reason, "Unable to find cman in config db");
+ write_cman_pipe(error_reason);
+ return -1;
}
objdb->object_find_destroy(find_handle);
- nodeid = atoi(nodeid_str);
- error = 0;
-
- /* optional port */
- if (!portnum) {
- objdb_get_int(objdb, object_handle, "port", &portnum, DEFAULT_PORT);
- }
-
/* Check for broadcast */
if (!objdb_get_string(objdb, object_handle, "broadcast", &str)) {
if (strcmp(str, "yes") == 0) {
- mcast_name = strdup("255.255.255.255");
- if (!mcast_name)
- return -1;
+ broadcast = 1;
transport = TX_MECH_UDPB;
}
}
/* Check for transport */
if (!objdb_get_string(objdb, object_handle, "transport", &str)) {
+ if ((broadcast) && (strcmp(str, "udpb"))) {
+ sprintf(error_reason, "Transport and broadcast option are mutually exclusive");
+ write_cman_pipe(error_reason);
+ return -1;
+ }
if (strcmp(str, "udp") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_UDP;
- }
+ transport = TX_MECH_UDP;
} else if (strcmp(str, "udpb") == 0) {
+ broadcast = 1;
transport = TX_MECH_UDPB;
} else if (strcmp(str, "udpu") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_UDPU;
- } else {
- sprintf(error_reason, "Transport and broadcast option are mutually exclusive");
- write_cman_pipe("Transport and broadcast option are mutually exclusive");
- return -1;
- }
+ transport = TX_MECH_UDPU;
} else if (strcmp(str, "rdma") == 0) {
- if (transport != TX_MECH_UDPB) {
- transport = TX_MECH_RDMA;
- } else {
- sprintf(error_reason, "Transport and broadcast option are mutually exclusive");
- write_cman_pipe("Transport and broadcast option are mutually exclusive");
- return -1;
- }
+ transport = TX_MECH_RDMA;
} else {
sprintf(error_reason, "Transport option value can be one of udp, udpb, udpu, rdma");
- write_cman_pipe("Transport option value can be one of udp, udpb, udpu, rdma");
+ write_cman_pipe(error_reason);
+ return -1;
+ }
+ }
+
+ if (broadcast) {
+ mcast_name = strdup("255.255.255.255");
+ if (!mcast_name) {
+ sprintf(error_reason, "Unable to set mcast_name");
+ write_cman_pipe(error_reason);
+ return -1;
+ }
+ altmcast_name = strdup("255.255.255.255");
+ if (!altmcast_name) {
+ sprintf(error_reason, "Unable to set altmcast_name");
+ write_cman_pipe(error_reason);
return -1;
}
+ altmcast_portnum = DEFAULT_PORT + 2;
+ }
+
+ objdb->object_find_create(object_handle, "multicast", strlen("multicast"), &find_handle);
+ if (objdb->object_find_next(find_handle, &mcast_handle) == 0) {
+ if (!mcast_name)
+ objdb_get_string(objdb, mcast_handle, "addr", &mcast_name);
+ objdb_get_int(objdb, mcast_handle, "ttl", &ttl, ttl);
+ objdb_get_int(objdb, mcast_handle, "port", &mcast_portnum, DEFAULT_PORT);
+ }
+ objdb->object_find_destroy(find_handle);
+
+ if (!mcast_name) {
+ mcast_name = default_mcast(nodename, PRIMARY_IFACE);
+ }
+
+ if (!mcast_name) {
+ sprintf(error_reason, "Unable to set mcast_name");
+ write_cman_pipe(error_reason);
+ return -1;
+ }
+
+ objdb->object_find_create(object_handle, "altmulticast", strlen("altmulticast"), &find_handle);
+ if (objdb->object_find_next(find_handle, &mcast_handle) == 0) {
+ objdb_get_string(objdb, mcast_handle, "addr", &altmcast_name_tmp);
+ objdb_get_int(objdb, mcast_handle, "ttl", &altttl, ttl);
+ if (!broadcast) {
+ objdb_get_int(objdb, mcast_handle, "port", &altmcast_portnum, DEFAULT_PORT);
+ } else {
+ objdb_get_int(objdb, mcast_handle, "port", &altmcast_portnum, DEFAULT_PORT + 2);
+ }
+ }
+ objdb->object_find_destroy(find_handle);
+
+ /* See if the user wants our default set of openais services (default=yes) */
+ objdb_get_int(objdb, object_handle, "disable_openais", &disable_openais, 0);
+
+ objdb->object_key_create_typed(object_handle, "nodename",
+ nodename, strlen(nodename)+1, OBJDB_VALUETYPE_STRING);
+
+ nodeid = atoi(nodeid_str);
+ error = 0;
+
+ /* optional port */
+ if (!portnum) {
+ objdb_get_int(objdb, object_handle, "port", &portnum, mcast_portnum);
}
if (add_ifaddr(objdb, mcast_name, nodename, portnum, ttl,
@@ -765,24 +806,43 @@ static int get_nodename(struct objdb_iface_ver0 *objdb)
num_nodenames = 1;
objdb->object_find_create(node_object_handle,"altname", strlen("altname"), &find_handle);
while (objdb->object_find_next(find_handle, &alt_object) == 0) {
- unsigned int port;
- unsigned int altttl = 1;
char *node;
- char *mcast;
if (objdb_get_string(objdb, alt_object, "name", &node)) {
continue;
}
- objdb_get_int(objdb, alt_object, "port", &port, portnum);
+ objdb_get_int(objdb, alt_object, "port", &altportnum, altmcast_portnum);
- objdb_get_int(objdb, alt_object, "ttl", &altttl, ttl);
+ objdb_get_int(objdb, alt_object, "ttl", &altttl, altttl);
- if (objdb_get_string(objdb, alt_object, "mcast", &mcast)) {
- mcast = default_mcast(nodename, ALT_IFACE);
+ if (!altmcast_name) {
+ if (objdb_get_string(objdb, alt_object, "mcast", &altmcast_name)) {
+ if (altmcast_name_tmp) {
+ altmcast_name = altmcast_name_tmp;
+ } else {
+ altmcast_name = default_mcast(nodename, ALT_IFACE);
+ }
+ }
+ }
+
+ if (!altmcast_name) {
+ sprintf(error_reason, "Unable to determine alternate multicast name");
+ write_cman_pipe(error_reason);
+ return -1;
}
- if (add_ifaddr(objdb, mcast, node, portnum, altttl,
+ if (!strcmp(altmcast_name, mcast_name) &&
+ ((altportnum == portnum) || (altportnum == portnum - 1) || (portnum == altportnum - 1))) {
+ sprintf(error_reason, "Alternate communication channel (mcast: %s ports: %d,%d) cannot use\n"
+ "same address and ports of primary channel (mcast: %s ports: %d,%d)",
+ altmcast_name, altportnum, altportnum - 1,
+ mcast_name, portnum, portnum - 1);
+ write_cman_pipe(error_reason);
+ return -1;
+ }
+
+ if (add_ifaddr(objdb, altmcast_name, node, altportnum, altttl,
ALT_IFACE, transport)) {
write_cman_pipe(error_reason);
return -1;
@@ -1310,9 +1370,6 @@ static int get_cman_globals(struct objdb_iface_ver0 *objdb)
/* Get the <cman> bits that override <totem> bits */
objdb->object_find_create(cluster_parent_handle, "cman", strlen("cman"), &find_handle);
if (objdb->object_find_next(find_handle, &object_handle) == 0) {
- if (!portnum)
- objdb_get_int(objdb, object_handle, "port", &portnum, DEFAULT_PORT);
-
if (!key_filename)
objdb_get_string(objdb, object_handle, "keyfile", &key_filename);
diff --git a/config/tools/xml/cluster.rng.in.head b/config/tools/xml/cluster.rng.in.head
index 11d5052..a669c98 100644
--- a/config/tools/xml/cluster.rng.in.head
+++ b/config/tools/xml/cluster.rng.in.head
@@ -144,26 +144,25 @@ To validate your cluster.conf against this schema, run:
</optional>
<optional>
<element name="multicast" rha:description="The multicast element
- provides the ability for a user to specify a multicast address
- instead of using the multicast address generated by cman. If
+ provides the ability for a user to specify a multicast address,
+ port and TTL (Time To Live) instead of using cman defaults. If
a user does not specify a multicast address, cman creates one. It
- forms the upper 16 bits of the multicast address with 239.192 and
- forms the lower 16 bits based on the cluster ID.">
- <optional>
- <attribute name="addr" rha:description="A multicast address specified
- by a user. If you do specify a multicast address, you should
- use the 239.192.x.x series that cman uses. Otherwise, using a
- multicast address outside that range may cause unpredictable
- results. For example, using 224.0.0.x (All hosts on the network)
- may not be routed correctly, or even routed at all by some
- hardware." rha:sample="239.192.0.1"/>
- </optional>
- <optional>
- <attribute name="ttl" rha:description="Define the TTL (time to live) of
- a multicast packets. Useful only if nodes are on different subnets and
- a multicast router is available in between." rha:default="1"
- rha:sample="24"/>
- </optional>
+ forms the upper 16 bits of the multicast address with 239.192 for
+ IPv4 and ff15:: for IPv6 and forms the lower 16 bits based on
+ the cluster ID.">
+ <ref name="MULTICASTOPTS"/>
+ </element>
+ </optional>
+ <optional>
+ <element name="altmulticast" rha:description="The altmulticast element
+ provides the ability for a user to specify a multicast address,
+ port and TTL (Time To Live) instead of using cman defaults for
+ the alternate communication channel (RRP). If a user does not
+ specify an alternate multicast address, cman creates one. It
+ forms the upper 16 bits of the multicast address with 239.192 for
+ IPv4 and ff15:: for IPv6 and forms the lower 16 bits based on
+ the cluster ID + 1.">
+ <ref name="MULTICASTOPTS"/>
</element>
</optional>
</element>
@@ -1013,6 +1012,33 @@ To validate your cluster.conf against this schema, run:
</element> <!-- cluster end -->
</start>
+<!-- begin mcast definitions -->
+
+ <define name="MULTICASTOPTS">
+ <optional>
+ <attribute name="addr" rha:description="A multicast address specified
+ by a user. If you do specify a multicast address, you should
+ use the 239.192.x.x series that cman uses. Otherwise, using a
+ multicast address outside that range may cause unpredictable
+ results. For example, using 224.0.0.x (All hosts on the network)
+ may not be routed correctly, or even routed at all by some
+ hardware." rha:sample="239.192.0.1"/>
+ </optional>
+ <optional>
+ <attribute name="ttl" rha:description="Define the TTL (time to live) of
+ a multicast packets. Useful only if nodes are on different subnets and
+ a multicast router is available in between." rha:default="1"
+ rha:sample="24"/>
+ </optional>
+ <optional>
+ <attribute name="port">
+ <data type="nonNegativeInteger"/>
+ </attribute>
+ </optional>
+ </define>
+
+<!-- end mcast definitions -->
+
<!-- begin node altname definitions -->
<define name="ALTNAME">