cluster: RHEL57 - fence_vmware_soap: Fix RHEL5-specific path issue
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 1f2194c131c4dc6a12c61e7e69b79e27309aa5d1
Parent: c8c6238a72125e1dbc62186fb246f8a0d5dc0a66
Author: Toure Dunnon <tdunnon(a)redhat.com>
AuthorDate: Tue Jun 28 13:48:42 2011 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Tue Jun 28 14:07:07 2011 -0400
fence_vmware_soap: Fix RHEL5-specific path issue
The other paths in the agents in the RHEL5 branch have
/usr/lib/fence hardcoded; the cluster software's build
environment in RHEL5 does not substitute
@FENCEAGENTSLIBDIR@ like it does on later releases of
Fedora and RHEL. Consequently, this patch is necessary
to avoid an error from the agent due to being unable to
locate the fencing.py module.
Resolves: rhbz#717372
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Tested-by: Toure Dunnon <tdunnon(a)redhat.com>
---
fence/agents/vmware_soap/fence_vmware_soap.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index 2718560..8008144 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
import sys, re, pexpect, exceptions
-sys.path.append("@FENCEAGENTSLIBDIR@")
+sys.path.append("/usr/lib/fence")
from suds.client import Client
from suds import WebFault
12 years, 10 months
fence-agents: master - relaxng: drop static agents definitions
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 195f28293701ab6582e23c9d6cb796efab0dce52
Parent: 9f8bb4d49ba6a96375feff2ae03bf30a708d1d45
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jun 27 20:54:03 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 27 20:54:03 2011 +0200
relaxng: drop static agents definitions
GNBD: obsoleted
fence_scsi/fence_virt/fence_xvm are now autogenerated
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
fence/agents/lib/fence.rng.head | 111 ---------------------------------------
1 files changed, 0 insertions(+), 111 deletions(-)
diff --git a/fence/agents/lib/fence.rng.head b/fence/agents/lib/fence.rng.head
index 1bc6929..c7df520 100644
--- a/fence/agents/lib/fence.rng.head
+++ b/fence/agents/lib/fence.rng.head
@@ -64,40 +64,6 @@
parameter." rha:sample=""/>
</optional>
</group>
- <!-- scsi reservations -->
- <group rha:fence_agent="fence_scsi">
- <optional>
- <attribute name="nodename" rha:description="Name of the node to
- be fenced. Refer to fence_scsi(8) for more
- information." rha:sample=""/>
- </optional>
- <optional>
- <attribute name="key" rha:description="" rha:sample="33">
- <data type="positiveInteger"/>
- </attribute>
- </optional>
- <optional>
- <attribute name="devices" rha:description="List of devices
- to fence (separated by commas)." rha:sample="/dev/sdb,/dev/sdc"/>
- </optional>
- <optional>
- <attribute name="action" rha:description="Fencing action to
- take (off or on)." rha:sample="off"/>
- </optional>
- <optional>
- <attribute name="logfile" rha:description="Location to output
- logs from fence_scsi." rha:sample="/var/log/fence_scsi.log"/>
- </optional>
- <optional>
- <attribute name="aptpl" rha:description="" rha:sample=""/>
- </optional>
- </group>
- <!-- GNBD -->
- <group rha:fence_agent="fence_gnbd">
- <attribute name="servers" rha:description="The hostname of each
- GNBD to disable. For multiple hostnames, separate each
- hostname with a space." rha:sample=""/>
- </group>
<!-- Egenera -->
<!-- FIXME: Note that in the schema web page each is listed as a
parameter. Likewise for Conga. In addition, Conga shows Ipan
@@ -136,83 +102,6 @@
<group rha:fence_agent="fence_xcat">
<attribute name="rpowerpath" rha:description="" rha:sample=""/>
</group>
- <!-- fence_xvm ( provided by fence-virt package ) -->
- <group rha:fence_agent="fence_xvm">
- <optional>
- <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
- </optional>
- <optional>
- <attribute name="debug" rha:description="Specify (stdin) or increment (command line) debug level" />
- </optional>
- <optional>
- <attribute name="ip_family" rha:description="IP Family ([auto], ipv4, ipv6)" />
- </optional>
- <optional>
- <attribute name="multicast_address" rha:description="Multicast address (default=225.0.0.12 / ff05::3:1)" />
- </optional>
- <optional>
- <attribute name="ipport" rha:description="Multicast or VMChannel IP port (default=1229)" />
- </optional>
- <optional>
- <attribute name="retrans" rha:description="Multicast retransmit time (in 1/10sec; default=20)" />
- </optional>
- <optional>
- <attribute name="auth" rha:description="Authentication (none, sha1, [sha256], sha512)" />
- </optional>
- <optional>
- <attribute name="hash" rha:description="Packet hash strength (none, sha1, [sha256], sha512)" />
- </optional>
- <optional>
- <attribute name="key_file" rha:description="Shared key file (default=/etc/cluster/fence_xvm.key)" />
- </optional>
- <optional>
- <attribute name="port" rha:description="Virtual Machine (domain name) to fence" />
- </optional>
- <optional>
- <attribute name="domain" rha:description="Virtual Machine (domain name) to fence (deprecated)" />
- </optional>
- <optional>
- <attribute name="use_uuid" rha:description="Treat [domain] as UUID instead of domain name. This is provided for compatibility with older fence_xvmd installations." />
- </optional>
- <optional>
- <attribute name="action" rha:description="Fencing action (null, off, on, [reboot], status, list, monitor, metadata)" />
- </optional>
- <optional>
- <attribute name="timeout" rha:description="Fencing timeout (in seconds; default=30)" />
- </optional>
- </group>
- <group rha:fence_agent="fence_virt">
- <optional>
- <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
- </optional>
- <optional>
- <attribute name="debug" rha:description="Specify (stdin) or increment (command line) debug level" />
- </optional>
- <optional>
- <attribute name="serial_device" rha:description="Serial device (default=/dev/ttyS1)" />
- </optional>
- <optional>
- <attribute name="serial_params" rha:description="Serial Parameters (default=115200,8N1)" />
- </optional>
- <optional>
- <attribute name="channel_address" rha:description="VM Channel IP address (default=10.0.2.179)" />
- </optional>
- <optional>
- <attribute name="ipport" rha:description="Multicast or VMChannel IP port (default=1229)" />
- </optional>
- <optional>
- <attribute name="port" rha:description="Virtual Machine (domain name) to fence" />
- </optional>
- <optional>
- <attribute name="domain" rha:description="Virtual Machine (domain name) to fence (deprecated)" />
- </optional>
- <optional>
- <attribute name="action" rha:description="Fencing action (null, off, on, [reboot], status, list, monitor, metadata)" />
- </optional>
- <optional>
- <attribute name="timeout" rha:description="Fencing timeout (in seconds; default=30)" />
- </optional>
- </group>
<group rha:fence_agent="fence_na" rha:description="Node Assassin">
<optional>
<attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
12 years, 10 months
fence-agents: master - relaxng: drop <grammar> definition
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 9f8bb4d49ba6a96375feff2ae03bf30a708d1d45
Parent: 0c4c884b54cd25f02bf8b41106ad2855c14cdf67
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jun 27 19:44:10 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 27 19:44:10 2011 +0200
relaxng: drop <grammar> definition
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
fence/agents/lib/fence.rng.head | 3 ---
fence/agents/lib/fence.rng.tail | 1 -
2 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/fence/agents/lib/fence.rng.head b/fence/agents/lib/fence.rng.head
index 89bac03..1bc6929 100644
--- a/fence/agents/lib/fence.rng.head
+++ b/fence/agents/lib/fence.rng.head
@@ -1,7 +1,4 @@
<!-- Autogenerated fence definitions -->
-<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
-xmlns="http://relaxng.org/ns/structure/1.0"
-xmlns:rha="http://redhat.com/~pkennedy/annotation_namespace/cluster_conf_annot_names...">
<define name="FENCEDEVICEOPTIONS">
<optional>
<choice>
diff --git a/fence/agents/lib/fence.rng.tail b/fence/agents/lib/fence.rng.tail
index 204e6c0..2feab91 100644
--- a/fence/agents/lib/fence.rng.tail
+++ b/fence/agents/lib/fence.rng.tail
@@ -11,4 +11,3 @@
</optional>
</define>
<!-- end fence attribute group definitions -->
-</grammar>
12 years, 10 months
fence-agents: master - relaxng: ship bits required to build the schema at runtime
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 0c4c884b54cd25f02bf8b41106ad2855c14cdf67
Parent: 08ae2ac78f3e4b216edf4b6689ac235ec9153c6c
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jun 27 14:07:57 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 27 14:07:57 2011 +0200
relaxng: ship bits required to build the schema at runtime
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
fence/agents/lib/Makefile.am | 10 ++-
fence/agents/lib/fence.rng.head | 250 +++++++++++++++++++++++++++++++++++++++
fence/agents/lib/fence.rng.tail | 14 ++
3 files changed, 273 insertions(+), 1 deletions(-)
diff --git a/fence/agents/lib/Makefile.am b/fence/agents/lib/Makefile.am
index 4a05d1b..f2fbb09 100644
--- a/fence/agents/lib/Makefile.am
+++ b/fence/agents/lib/Makefile.am
@@ -8,12 +8,20 @@ endif
SRC = fencing.py.py fencing_snmp.py.py XenAPI.py.py
-EXTRA_DIST = $(SRC) fence2man.xsl fence2rng.xsl
+XSL = fence2man.xsl fence2rng.xsl
+
+FASRNG = fence.rng.head fence.rng.tail
+
+EXTRA_DIST = $(SRC) $(XSL) $(FASRNG)
fencelibdir = ${FENCEAGENTSLIBDIR}
fencelib_DATA = $(TARGET)
+rngdir = ${CLUSTERDATA}/relaxng
+
+rng_DATA = $(XSL) $(FASRNG)
+
include $(top_srcdir)/make/fencebuild.mk
clean-local:
diff --git a/fence/agents/lib/fence.rng.head b/fence/agents/lib/fence.rng.head
new file mode 100644
index 0000000..89bac03
--- /dev/null
+++ b/fence/agents/lib/fence.rng.head
@@ -0,0 +1,250 @@
+<!-- Autogenerated fence definitions -->
+<grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
+xmlns="http://relaxng.org/ns/structure/1.0"
+xmlns:rha="http://redhat.com/~pkennedy/annotation_namespace/cluster_conf_annot_names...">
+ <define name="FENCEDEVICEOPTIONS">
+ <optional>
+ <choice>
+ <!-- begin specific fence devices -->
+ <!-- begin non-generated device definitions -->
+ <!-- RPS10 -->
+ <group rha:fence_agent="fence_rps10" rha:description="RPS10 Serial Switch" >
+ <attribute name="device" rha:description="The device the switch
+ is connected to on the controlling host."
+ rha:sample="/dev/ttys2"/>
+ <attribute name="port" rha:description="The switch outlet
+ number." rha:sample="2"/>
+ </group>
+ <!--FIXME: Determine if the following group should exclude
+ the auth and lanplus attributes. Those attributes apply only to
+ the impilan fence device.-->
+ <!-- Brocade, McData, SANBox2, Bladecenter,bullpap, ipmilan -->
+ <!-- FIXME split apart and add rha:fence_agent hints for
+ configuration utilities -->
+ <group>
+ <attribute name="ipaddr" rha:description="IP address or the name
+ of the device." rha:sample="rack007"/>
+ <optional>
+ <attribute name="login" rha:description="The login name used to
+ access the device. " rha:sample="admin"/>
+ </optional>
+ <optional>
+ <attribute name="passwd" rha:description="The password used to
+ authenticate the connection to the
+ device." rha:sample="pa$$word"/>
+ </optional>
+ <optional>
+ <attribute name="passwd_script" rha:description="The script that
+ supplies a password for access to the fence device. Using
+ this supersedes the Password parameter." rha:sample=""/>
+ </optional>
+ <optional>
+ <attribute name="auth" rha:description="For IPMI LAN
+ only. Authentication Type: none, password,
+ md2, or md5" rha:sample=""/>
+ </optional>
+ <optional>
+ <attribute name="lanplus" rha:description="For IPMI LAN only.
+ Set value to either True or 1; leave out for false."
+ rha:sample="True"/>
+ </optional>
+ </group>
+ <!-- Vixel -->
+ <group rha:fence_agent="fence_vixel">
+ <optional>
+ <attribute name="ipaddr" rha:description="IP address or the
+ name of the device." rha:sample="10.1.0.1"/>
+ </optional>
+ <optional>
+ <attribute name="passwd" rha:description="The password used to
+ authenticate the connection to the
+ device." rha:sample="pa$$word"/>
+ </optional>
+ <optional>
+ <attribute name="passwd_script" rha:description="The script
+ that supplies a password for access to the
+ fence device. Using this supersedes the Password
+ parameter." rha:sample=""/>
+ </optional>
+ </group>
+ <!-- scsi reservations -->
+ <group rha:fence_agent="fence_scsi">
+ <optional>
+ <attribute name="nodename" rha:description="Name of the node to
+ be fenced. Refer to fence_scsi(8) for more
+ information." rha:sample=""/>
+ </optional>
+ <optional>
+ <attribute name="key" rha:description="" rha:sample="33">
+ <data type="positiveInteger"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="devices" rha:description="List of devices
+ to fence (separated by commas)." rha:sample="/dev/sdb,/dev/sdc"/>
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Fencing action to
+ take (off or on)." rha:sample="off"/>
+ </optional>
+ <optional>
+ <attribute name="logfile" rha:description="Location to output
+ logs from fence_scsi." rha:sample="/var/log/fence_scsi.log"/>
+ </optional>
+ <optional>
+ <attribute name="aptpl" rha:description="" rha:sample=""/>
+ </optional>
+ </group>
+ <!-- GNBD -->
+ <group rha:fence_agent="fence_gnbd">
+ <attribute name="servers" rha:description="The hostname of each
+ GNBD to disable. For multiple hostnames, separate each
+ hostname with a space." rha:sample=""/>
+ </group>
+ <!-- Egenera -->
+ <!-- FIXME: Note that in the schema web page each is listed as a
+ parameter. Likewise for Conga. In addition, Conga shows Ipan
+ and pserver parameters. Also, in Conga, the esh parameter is
+ an optional ESH path. Presumably those should be attributes in
+ the schema. We need more invormation on this. -->
+ <group rha:fence_agent="fence_egenera">
+ <optional>
+ <attribute name="cserver" rha:description="The hostname (and
+ optionally the username in the form of username@hostname)
+ assigned to the device. Refer to the fence_egenera(8) man
+ page for more information." rha:sample=""/>
+ </optional>
+ <optional>
+ <attribute name="pserver" rha:description="The pserver to operate on. fence_egenera(8)" />
+ </optional>
+ <optional>
+ <attribute name="lpan" rha:description="The lpan to operate on. fence_egenera(8)" />
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="The action to perform (reboot, off, on, or status). fence_egenera(8)" />
+ </optional>
+ <optional>
+ <attribute name="esh" rha:description="Path to the esh command on the cserver. fence_egenera(8)" />
+ </optional>
+ <optional>
+ <attribute name="user" rha:description="See fence_egenera(8)" />
+ </optional>
+ <optional>
+ <attribute name="delay" rha:description="Wait this many seconds before fencing is started. fence_egenera(8)" />
+ </optional>
+ </group>
+ <!-- FIXME: It appears that xCat is no longer supported. Found no
+ fence agents for x Cat in RHEL 5.3. -->
+ <!-- xCAT -->
+ <group rha:fence_agent="fence_xcat">
+ <attribute name="rpowerpath" rha:description="" rha:sample=""/>
+ </group>
+ <!-- fence_xvm ( provided by fence-virt package ) -->
+ <group rha:fence_agent="fence_xvm">
+ <optional>
+ <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
+ </optional>
+ <optional>
+ <attribute name="debug" rha:description="Specify (stdin) or increment (command line) debug level" />
+ </optional>
+ <optional>
+ <attribute name="ip_family" rha:description="IP Family ([auto], ipv4, ipv6)" />
+ </optional>
+ <optional>
+ <attribute name="multicast_address" rha:description="Multicast address (default=225.0.0.12 / ff05::3:1)" />
+ </optional>
+ <optional>
+ <attribute name="ipport" rha:description="Multicast or VMChannel IP port (default=1229)" />
+ </optional>
+ <optional>
+ <attribute name="retrans" rha:description="Multicast retransmit time (in 1/10sec; default=20)" />
+ </optional>
+ <optional>
+ <attribute name="auth" rha:description="Authentication (none, sha1, [sha256], sha512)" />
+ </optional>
+ <optional>
+ <attribute name="hash" rha:description="Packet hash strength (none, sha1, [sha256], sha512)" />
+ </optional>
+ <optional>
+ <attribute name="key_file" rha:description="Shared key file (default=/etc/cluster/fence_xvm.key)" />
+ </optional>
+ <optional>
+ <attribute name="port" rha:description="Virtual Machine (domain name) to fence" />
+ </optional>
+ <optional>
+ <attribute name="domain" rha:description="Virtual Machine (domain name) to fence (deprecated)" />
+ </optional>
+ <optional>
+ <attribute name="use_uuid" rha:description="Treat [domain] as UUID instead of domain name. This is provided for compatibility with older fence_xvmd installations." />
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Fencing action (null, off, on, [reboot], status, list, monitor, metadata)" />
+ </optional>
+ <optional>
+ <attribute name="timeout" rha:description="Fencing timeout (in seconds; default=30)" />
+ </optional>
+ </group>
+ <group rha:fence_agent="fence_virt">
+ <optional>
+ <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
+ </optional>
+ <optional>
+ <attribute name="debug" rha:description="Specify (stdin) or increment (command line) debug level" />
+ </optional>
+ <optional>
+ <attribute name="serial_device" rha:description="Serial device (default=/dev/ttyS1)" />
+ </optional>
+ <optional>
+ <attribute name="serial_params" rha:description="Serial Parameters (default=115200,8N1)" />
+ </optional>
+ <optional>
+ <attribute name="channel_address" rha:description="VM Channel IP address (default=10.0.2.179)" />
+ </optional>
+ <optional>
+ <attribute name="ipport" rha:description="Multicast or VMChannel IP port (default=1229)" />
+ </optional>
+ <optional>
+ <attribute name="port" rha:description="Virtual Machine (domain name) to fence" />
+ </optional>
+ <optional>
+ <attribute name="domain" rha:description="Virtual Machine (domain name) to fence (deprecated)" />
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Fencing action (null, off, on, [reboot], status, list, monitor, metadata)" />
+ </optional>
+ <optional>
+ <attribute name="timeout" rha:description="Fencing timeout (in seconds; default=30)" />
+ </optional>
+ </group>
+ <group rha:fence_agent="fence_na" rha:description="Node Assassin">
+ <optional>
+ <attribute name="option"/> <!-- deprecated; for compatibility. use "action" -->
+ </optional>
+ <!-- I don't think I need this yet.
+ <optional>
+ <attribute name="auth" rha:description="Node Assassin Auth type (password or none)" />
+ </optional>
+ -->
+ <optional>
+ <attribute name="ipaddr" rha:description="Node Assassin IP or name to talk to" />
+ </optional>
+ <optional>
+ <attribute name="passwd" rha:description="Password needed to access the Node Assassin(s)" />
+ </optional>
+ <optional>
+ <attribute name="passwd_script" rha:description="Script to retrieve password (not implemented)" />
+ </optional>
+ <optional>
+ <attribute name="login" rha:description="Login name used to log into the Node Assassin(s)" />
+ </optional>
+ <optional>
+ <attribute name="action" rha:description="Operation to perform. Valid operations: on, off, reboot, status, list, release, boot or shutdown" />
+ </optional>
+ <optional>
+ <attribute name="quiet" rha:description="Supress output" />
+ </optional>
+ </group>
+
+ <!-- end non-generated device definitions -->
+
+ <!-- begin auto-generated device definitions -->
diff --git a/fence/agents/lib/fence.rng.tail b/fence/agents/lib/fence.rng.tail
new file mode 100644
index 0000000..204e6c0
--- /dev/null
+++ b/fence/agents/lib/fence.rng.tail
@@ -0,0 +1,14 @@
+ <!-- end auto-generated device definitions -->
+
+ <group>
+ <optional>
+ <empty/>
+ </optional>
+ </group>
+
+ <!-- end specific fence devices -->
+ </choice>
+ </optional>
+ </define>
+<!-- end fence attribute group definitions -->
+</grammar>
12 years, 10 months
fence-agents: master - Make fence_ack_manual 'usage' more accessible
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=com...
Commit: 08ae2ac78f3e4b216edf4b6689ac235ec9153c6c
Parent: f6b654346219f2b8595e0caea5c7ab52f39b7751
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Jun 22 11:12:55 2011 -0400
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jun 27 10:34:38 2011 +0200
Make fence_ack_manual 'usage' more accessible
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
fence/agents/manual/fence_ack_manual.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/manual/fence_ack_manual.in b/fence/agents/manual/fence_ack_manual.in
index 69a0aa0..e8b4998 100644
--- a/fence/agents/manual/fence_ack_manual.in
+++ b/fence/agents/manual/fence_ack_manual.in
@@ -7,7 +7,7 @@ if [ "$1" = "-n" ]; then
shift
fi
-if [ -z "$1" ] || [ "$1" = "-h" ]; then
+if [ -z "$1" ] || [ "${1:0:1}" = "-" ]; then
echo "usage:"
echo " $0 <nodename>"
echo " $0 -n <nodename>"
12 years, 10 months
cluster: RHEL57 - rgmanager: Fix bad passing of SFL_FAILURE up
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c8c6238a72125e1dbc62186fb246f8a0d5dc0a66
Parent: 9be62ccbea876e67b8ad4bb3c1b4203feb4fc1f7
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Jun 23 10:36:09 2011 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Fri Jun 24 08:22:09 2011 -0400
rgmanager: Fix bad passing of SFL_FAILURE up
We were handling failures at the 'highest' independent subtree
level instead of lowest; this patch fixes that.
Resolves: rhbz#711521
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
Reviewed-by: Bob Peterson <rpeterso(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 697c7b1..4e5f3bc 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1603,7 +1603,7 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
and all our children as failed and return a flag stating
that this section is recoverable apart from siblings in
the resource tree. */
- if (op == RS_STATUS && (rv & (SFL_FAILURE|SFL_RECOVERABLE)) &&
+ if (op == RS_STATUS && (rv & SFL_FAILURE) &&
(node->rn_flags & RF_INDEPENDENT)) {
rte = restart_threshold_exceeded(node->rn_restart_counter);
12 years, 10 months
cluster: STABLE31 - rgmanager: Fix bad passing of SFL_FAILURE up
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: ead472031bf6d813b57580911ff70611bbc24dfb
Parent: 72fca398e2a0cd5eb08f575b415cf815c73a84ad
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Thu Jun 23 10:36:09 2011 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Jun 23 13:43:12 2011 -0400
rgmanager: Fix bad passing of SFL_FAILURE up
We were handling failures at the 'highest' independent subtree
level instead of lowest; this patch fixes that.
Resolves: rhbz#711521
Resolves: rhbz#716231
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/daemons/restree.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 739bbc8..8ce1364 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -1546,7 +1546,7 @@ _res_op_internal(resource_node_t __attribute__ ((unused)) **tree,
and all our children as failed and return a flag stating
that this section is recoverable apart from siblings in
the resource tree. */
- if (op == RS_STATUS && (rv & (SFL_FAILURE|SFL_RECOVERABLE)) &&
+ if (op == RS_STATUS && (rv & SFL_FAILURE) &&
(node->rn_flags & RF_INDEPENDENT)) {
rte = restart_threshold_exceeded(node->rn_restart_counter);
12 years, 10 months
cluster: STABLE31 - rgmanager: Fix errors found during static analysis
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 72fca398e2a0cd5eb08f575b415cf815c73a84ad
Parent: e2937eb33f224f86904fead08499a6178868ca6a
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Mon May 23 16:51:10 2011 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Jun 23 13:42:42 2011 -0400
rgmanager: Fix errors found during static analysis
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/clulib/daemon_init.c | 1 -
rgmanager/src/clulib/lock.c | 3 ---
rgmanager/src/clulib/members.c | 8 ++++++--
rgmanager/src/clulib/message.c | 2 +-
rgmanager/src/clulib/msg_socket.c | 4 +++-
rgmanager/src/clulib/vft.c | 30 ++++++++++++++----------------
rgmanager/src/daemons/event_config.c | 4 +++-
rgmanager/src/daemons/fo_domain.c | 18 +++++++++++++-----
rgmanager/src/daemons/main.c | 4 ++++
rgmanager/src/daemons/resrules.c | 4 +++-
rgmanager/src/daemons/restree.c | 8 +++-----
rgmanager/src/daemons/rg_event.c | 6 ++++++
rgmanager/src/daemons/rg_state.c | 19 +++++++++++++------
rgmanager/src/daemons/rg_thread.c | 2 ++
rgmanager/src/daemons/test.c | 2 +-
rgmanager/src/utils/clustat.c | 10 ++++++----
rgmanager/src/utils/clusvcadm.c | 2 ++
17 files changed, 80 insertions(+), 47 deletions(-)
diff --git a/rgmanager/src/clulib/daemon_init.c b/rgmanager/src/clulib/daemon_init.c
index e9adeed..7703d34 100644
--- a/rgmanager/src/clulib/daemon_init.c
+++ b/rgmanager/src/clulib/daemon_init.c
@@ -50,7 +50,6 @@ check_pid_valid(pid_t pid, char *prog)
snprintf(dirpath, sizeof (dirpath), "/proc/%d", pid);
if ((dir = opendir(dirpath)) == NULL) {
- closedir(dir);
return 0; /* Pid has gone away. */
}
closedir(dir);
diff --git a/rgmanager/src/clulib/lock.c b/rgmanager/src/clulib/lock.c
index be542c1..078d525 100644
--- a/rgmanager/src/clulib/lock.c
+++ b/rgmanager/src/clulib/lock.c
@@ -50,9 +50,6 @@ clu_ls_lock(dlm_lshandle_t ls,
int ret;
if (!ls || !lksb || !resource || !strlen(resource)) {
- printf("%p %p %p %d\n", ls, lksb, resource,
- (int)strlen(resource));
- printf("INVAL...\n");
errno = EINVAL;
return -1;
}
diff --git a/rgmanager/src/clulib/members.c b/rgmanager/src/clulib/members.c
index 5f98708..e6475e1 100644
--- a/rgmanager/src/clulib/members.c
+++ b/rgmanager/src/clulib/members.c
@@ -282,14 +282,18 @@ get_member_list(cman_handle_t h)
}
do {
+retry:
++tries;
- if (nodes)
+ if (nodes) {
free(nodes);
+ nodes = NULL;
+ }
c = cman_get_node_count(h);
if (c <= 0) {
if (errno == EINTR)
- continue;
+ /* continue if ml == NULL -> crash */
+ goto retry;
if (ml)
free(ml);
ml = NULL;
diff --git a/rgmanager/src/clulib/message.c b/rgmanager/src/clulib/message.c
index 3eb7b2f..441d421 100644
--- a/rgmanager/src/clulib/message.c
+++ b/rgmanager/src/clulib/message.c
@@ -259,7 +259,7 @@ msg_new_ctx(void)
if (!p)
return NULL;
- memset(p, 0, sizeof(p));
+ memset(p, 0, sizeof(*p));
p->type = MSG_NONE;
return p;
diff --git a/rgmanager/src/clulib/msg_socket.c b/rgmanager/src/clulib/msg_socket.c
index a9c36d6..456858a 100644
--- a/rgmanager/src/clulib/msg_socket.c
+++ b/rgmanager/src/clulib/msg_socket.c
@@ -364,8 +364,10 @@ sock_msg_listen(int me, const void *portp, msgctx_t **listen_ctx)
return -1;
sock = socket(PF_LOCAL, SOCK_STREAM, 0);
- if (sock < 0)
+ if (sock < 0) {
+ msg_free_ctx(ctx);
return -1;
+ }
set_cloexec(sock);
unlink(RGMGR_SOCK);
diff --git a/rgmanager/src/clulib/vft.c b/rgmanager/src/clulib/vft.c
index 0113bad..08dad42 100644
--- a/rgmanager/src/clulib/vft.c
+++ b/rgmanager/src/clulib/vft.c
@@ -755,13 +755,6 @@ vf_try_commit(key_node_t *key_node)
free(cmp); /* no need for it any longer */
vnp = vn_remove(&key_node->kn_jvlist, trans);
- if (!vnp) {
- /*
- * But, we know it was the first element on the list?!!
- */
- fprintf(stderr,"VF: QUAAAAAAAAAAAAAACKKKK!");
- raise(SIGSTOP);
- }
#ifdef DEBUG
printf("VF: Commit Key %s #%d from member #%d\n",
@@ -1201,6 +1194,7 @@ vf_write(cluster_member_list_t *membership, uint32_t flags,
*/
if (msg_open(MSG_CLUSTER, 0, _port, &everyone, 0) < 0) {
printf("msg_open: fail: %s\n", strerror(errno));
+ free(join_view);
clu_unlock(&lockp);
pthread_mutex_unlock(&vf_mutex);
return -1;
@@ -1495,16 +1489,20 @@ vf_read(cluster_member_list_t *membership, const char *keyid, uint64_t *view,
}
}
- *data = malloc(key_node->kn_datalen);
- if (! *data) {
- pthread_mutex_unlock(&key_list_mutex);
- clu_unlock(&lockp);
- pthread_mutex_unlock(&vf_mutex);
- printf("Couldn't malloc %s\n", keyid);
- return VFR_ERROR;
- }
+ if (key_node->kn_datalen && key_node->kn_data) {
+ *data = malloc(key_node->kn_datalen);
+ if (! *data) {
+ pthread_mutex_unlock(&key_list_mutex);
+ clu_unlock(&lockp);
+ pthread_mutex_unlock(&vf_mutex);
+ printf("Couldn't malloc %s\n", keyid);
+ return VFR_ERROR;
+ }
- memcpy(*data, key_node->kn_data, key_node->kn_datalen);
+ memcpy(*data, key_node->kn_data, key_node->kn_datalen);
+ } else {
+ *data = NULL;
+ }
*datalen = key_node->kn_datalen;
*view = key_node->kn_viewno;
diff --git a/rgmanager/src/daemons/event_config.c b/rgmanager/src/daemons/event_config.c
index 4ab5bfc..9c4b8b3 100644
--- a/rgmanager/src/daemons/event_config.c
+++ b/rgmanager/src/daemons/event_config.c
@@ -291,8 +291,10 @@ get_event(int ccsfd, char *base, int idx, int *_done)
}
ev = malloc(sizeof(*ev));
- if (!ev)
+ if (!ev) {
+ free(ret);
return NULL;
+ }
memset(ev, 0, sizeof(*ev));
ev->ev_name = ret;
diff --git a/rgmanager/src/daemons/fo_domain.c b/rgmanager/src/daemons/fo_domain.c
index 638dde9..884f3ae 100644
--- a/rgmanager/src/daemons/fo_domain.c
+++ b/rgmanager/src/daemons/fo_domain.c
@@ -46,7 +46,7 @@ fod_get_node(int __attribute__((unused)) ccsfd, char *base, int idx, fod_t *doma
{
fod_node_t *fodn;
char xpath[256];
- char *ret;
+ char *ret = NULL;
snprintf(xpath, sizeof(xpath), "%s/failoverdomainnode[%d]/@name",
base, idx);
@@ -64,8 +64,10 @@ fod_get_node(int __attribute__((unused)) ccsfd, char *base, int idx, fod_t *doma
} while (!list_done(&domain->fd_nodes, fodn));
fodn = malloc(sizeof(*fodn));
- if (!fodn)
+ if (!fodn) {
+ free(ret);
return NULL;
+ }
memset(fodn, 0, sizeof(*fodn));
/* Already malloc'd; simply store */
@@ -82,6 +84,7 @@ fod_get_node(int __attribute__((unused)) ccsfd, char *base, int idx, fod_t *doma
} else {
/* 64-bit-ism on rhel4? */
fodn->fdn_nodeid = atoi(ret);
+ free(ret);
}
/* Don't even bother getting priority if we're not ordered (it's set
@@ -344,7 +347,7 @@ int
node_domain_set(fod_t **domains, char *name, int **ret, int *retlen, int *flags)
{
int x, i, j;
- int *tmpset;
+ int *tmpset = NULL;
int ts_count;
fod_node_t *fodn;
fod_t *domain;
@@ -368,8 +371,10 @@ node_domain_set(fod_t **domains, char *name, int **ret, int *retlen, int *flags)
if (!(*ret))
return -1;
tmpset = malloc(sizeof(int) * x);
- if (!(*tmpset))
+ if (!tmpset) {
+ free(*ret);
return -1;
+ }
*flags = domain->fd_flags;
@@ -404,8 +409,10 @@ node_domain_set(fod_t **domains, char *name, int **ret, int *retlen, int *flags)
}
}
- if (!ts_count)
+ if (!ts_count) {
+ free(tmpset);
return 0;
+ }
/* Shuffle stuff at this prio level */
if (ts_count > 1)
@@ -413,6 +420,7 @@ node_domain_set(fod_t **domains, char *name, int **ret, int *retlen, int *flags)
for (j = 0; j < ts_count; j++)
s_add(*ret, retlen, tmpset[j]);
+ free(tmpset);
return 0;
}
diff --git a/rgmanager/src/daemons/main.c b/rgmanager/src/daemons/main.c
index a3ab7c4..7ee8cf9 100644
--- a/rgmanager/src/daemons/main.c
+++ b/rgmanager/src/daemons/main.c
@@ -654,7 +654,11 @@ static void
dump_internal_state(const char *loc)
{
FILE *fp;
+ if (!loc)
+ return;
fp=fopen(loc, "w+");
+ if (!fp)
+ return;
dump_config_version(fp);
dump_threads(fp);
dump_vf_states(fp);
diff --git a/rgmanager/src/daemons/resrules.c b/rgmanager/src/daemons/resrules.c
index 41bb6e8..fac48d9 100644
--- a/rgmanager/src/daemons/resrules.c
+++ b/rgmanager/src/daemons/resrules.c
@@ -1048,8 +1048,10 @@ load_resource_rulefile(char *filename, resource_rule_t **rules)
}
rr = malloc(sizeof(*rr));
- if (!rr)
+ if (!rr) {
+ free(type);
break;
+ }
memset(rr,0,sizeof(*rr));
rr->rr_flags = RF_INIT | RF_DESTROY;
diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c
index 3892ab9..739bbc8 100644
--- a/rgmanager/src/daemons/restree.c
+++ b/rgmanager/src/daemons/restree.c
@@ -497,10 +497,9 @@ assign_restart_policy(resource_t *curres, resource_node_t *parent,
time_t restart_expire_time = 0;
char tok[1024];
- node->rn_restart_counter = NULL;
-
if (!curres || !node)
return;
+ node->rn_restart_counter = NULL;
if (parent &&
!(node->rn_flags & RF_INDEPENDENT))
return;
@@ -1199,9 +1198,8 @@ mark_nodes(resource_node_t *node, int state, int setflags, int clearflags)
resource_node_t *child;
list_for(&node->rn_child, child, x) {
- if (child)
- mark_nodes(child, state, setflags,
- clearflags);
+ mark_nodes(child, state, setflags,
+ clearflags);
}
if (state >= RES_STOPPED)
diff --git a/rgmanager/src/daemons/rg_event.c b/rgmanager/src/daemons/rg_event.c
index 7048bc6..6106e70 100644
--- a/rgmanager/src/daemons/rg_event.c
+++ b/rgmanager/src/daemons/rg_event.c
@@ -262,6 +262,7 @@ find_master(void)
} else {
masterinfo = (event_master_t *)data;
}
+
free_member_list(m);
if (masterinfo && (sz >= sizeof(*masterinfo))) {
@@ -275,7 +276,12 @@ find_master(void)
mi = masterinfo;
pthread_mutex_unlock(&mi_mutex);
master_id = masterinfo->m_nodeid;
+ } else {
+ free(data);
}
+ } else {
+ free(data);
+ masterinfo = NULL;
}
return master_id;
diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c
index babac7a..1aff7a8 100644
--- a/rgmanager/src/daemons/rg_state.c
+++ b/rgmanager/src/daemons/rg_state.c
@@ -265,9 +265,12 @@ get_rg_state(const char *name, rg_state_t *svcblk)
uint32_t datalen = 0;
#endif
- /* ... */
- if (name)
- strncpy(svcblk->rs_name, name, sizeof(svcblk->rs_name));
+ if (!name) {
+ errno = EINVAL;
+ return -1;
+ }
+
+ strncpy(svcblk->rs_name, name, sizeof(svcblk->rs_name));
snprintf(res, sizeof(res),"rg=\"%s\"", svcblk->rs_name);
@@ -360,9 +363,11 @@ get_rg_state_local(const char *name, rg_state_t *svcblk)
uint32_t datalen;
#endif
- /* ... */
- if (name)
- strncpy(svcblk->rs_name, name, sizeof(svcblk->rs_name));
+ if (!name) {
+ errno = EINVAL;
+ return -1;
+ }
+ strncpy(svcblk->rs_name, name, sizeof(svcblk->rs_name));
snprintf(res, sizeof(res),"rg=\"%s\"", svcblk->rs_name);
@@ -422,6 +427,7 @@ svc_advise_stop(rg_state_t *svcStatus, const char *svcName, int req)
if (svcStatus->rs_flags & RG_FLAG_FROZEN) {
logt_print(LOG_DEBUG, "Service %s frozen.\n", svcName);
+ free_member_list(membership);
return 5;
}
@@ -553,6 +559,7 @@ svc_advise_start(rg_state_t *svcStatus, const char *svcName, int req)
if (svcStatus->rs_flags & RG_FLAG_FROZEN) {
logt_print(LOG_DEBUG, "Service %s frozen.\n", svcName);
+ free_member_list(membership);
return 5;
}
diff --git a/rgmanager/src/daemons/rg_thread.c b/rgmanager/src/daemons/rg_thread.c
index 72b5f96..75af6f1 100644
--- a/rgmanager/src/daemons/rg_thread.c
+++ b/rgmanager/src/daemons/rg_thread.c
@@ -523,10 +523,12 @@ resgroup_thread_main(void *arg)
/* reslist_mutex and my_queue_mutex held */
myself = find_resthread_byname(myname);
+ /* Not reached...
if (!myself) {
dbg_printf("I don't exist...\n");
raise(SIGSEGV);
}
+ */
mystatus = pthread_mutex_destroy(&my_queue_mutex);
if (mystatus != 0)
diff --git a/rgmanager/src/daemons/test.c b/rgmanager/src/daemons/test.c
index 1982995..b0e326f 100644
--- a/rgmanager/src/daemons/test.c
+++ b/rgmanager/src/daemons/test.c
@@ -213,7 +213,7 @@ test_func(int argc, char **argv)
}
printf("Stop of %s complete\n", argv[3]);
goto out;
- } else if (!strcmp(argv[1], "migrate")) {
+ } else if (!strcmp(argv[1], "migrate") && rn != NULL) {
printf("Migrating %s to %s...\n", argv[3], argv[4]);
#if 0
diff --git a/rgmanager/src/utils/clustat.c b/rgmanager/src/utils/clustat.c
index d7e8dd8..f736b51 100644
--- a/rgmanager/src/utils/clustat.c
+++ b/rgmanager/src/utils/clustat.c
@@ -276,7 +276,7 @@ rg_state_list(int local_node_id, int fast)
free(rsl);
return NULL;
}
-
+
qsort(rsl->rgl_states, rsl->rgl_count, sizeof(rg_state_t),
rg_name_sort);
@@ -352,10 +352,12 @@ static cluster_member_list_t *ccs_member_list(void)
}
ccs_disconnect(desc);
- ret->cml_members = nodes;
- qsort(ret->cml_members, ret->cml_count, sizeof(cman_node_t),
- member_id_sort);
+ ret->cml_members = nodes;
+ if (nodes) {
+ qsort(ret->cml_members, ret->cml_count,
+ sizeof(cman_node_t), member_id_sort);
+ }
return ret;
}
diff --git a/rgmanager/src/utils/clusvcadm.c b/rgmanager/src/utils/clusvcadm.c
index 8d0b502..3de9237 100644
--- a/rgmanager/src/utils/clusvcadm.c
+++ b/rgmanager/src/utils/clusvcadm.c
@@ -49,6 +49,8 @@ do_lock_req(int req)
int me;
generic_msg_hdr hdr;
+ ctx.type = -1;
+
ch = cman_init(NULL);
if (!ch) {
printf("Could not connect to cluster service\n");
12 years, 10 months
cluster: STABLE31 - qdiskd: Make multipath issues go away
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e2937eb33f224f86904fead08499a6178868ca6a
Parent: 6707ff0f2a248dd0a05e13d9f563806cd93c6cb4
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Fri May 6 10:14:04 2011 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Jun 23 13:42:41 2011 -0400
qdiskd: Make multipath issues go away
Qdiskd hsitorically has required significant tuning to work around
delays which occur during multipath failover, overloaded I/O, and LUN
trespasses in both device-mapper-multipath and EMC PowerPath
environments.
This patch goes a very long way towards eliminating false evictions
when these conditions occur by making qdiskd whine to the other
cluster members when it detects hung system calls. When a cluster
member whines, it indicates the source of the problem (which system
call is hung), and the act of receiving a whine from a host indicates
that qdiskd is operational, but that I/O is hung. Hung I/O is different
from losing storage entirely (where you get I/O errors).
Possible problems:
- Receive queue getting very full, causing messages to become blocked on
a node where I/O is hung. 1) that would take a very long time, and 2)
node should get evicted at that point anyway.
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
cman/qdisk/Makefile | 2 +-
cman/qdisk/disk.h | 6 ++++++
cman/qdisk/iostate.c | 16 +++++++++++++---
cman/qdisk/iostate.h | 4 +++-
cman/qdisk/main.c | 45 ++++++++++++++++++++++++++++++++++++++++++---
5 files changed, 65 insertions(+), 8 deletions(-)
diff --git a/cman/qdisk/Makefile b/cman/qdisk/Makefile
index 68e20cd..e3bb5f7 100644
--- a/cman/qdisk/Makefile
+++ b/cman/qdisk/Makefile
@@ -40,7 +40,7 @@ ${TARGET1}: ${SHAREDOBJS} ${OBJS1}
$(CC) -o $@ $^ $(EXTRA_LDFLAGS) $(LDFLAGS)
${TARGET2}: ${SHAREDOBJS} ${OBJS2}
- $(CC) -o $@ $^ $(LDFLAGS)
+ $(CC) -o $@ $^ $(EXTRA_LDFLAGS) $(LDFLAGS)
depends:
$(MAKE) -C ../lib all
diff --git a/cman/qdisk/disk.h b/cman/qdisk/disk.h
index 93d15fe..fd80fa6 100644
--- a/cman/qdisk/disk.h
+++ b/cman/qdisk/disk.h
@@ -273,6 +273,12 @@ typedef struct {
status_block_t ni_status;
} node_info_t;
+typedef struct {
+ qd_ctx *ctx;
+ node_info_t *ni;
+ size_t ni_len;
+} qd_priv_t;
+
int qd_write_status(qd_ctx *ctx, int nid, disk_node_state_t state,
disk_msg_t *msg, memb_mask_t mask, memb_mask_t master);
int qd_init(qd_ctx *ctx, cman_handle_t ch_admin,
diff --git a/cman/qdisk/iostate.c b/cman/qdisk/iostate.c
index 0199da4..06c6831 100644
--- a/cman/qdisk/iostate.c
+++ b/cman/qdisk/iostate.c
@@ -1,9 +1,12 @@
#include <pthread.h>
+#include <libcman.h>
#include <iostate.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#include <liblogthread.h>
+#include <stdint.h>
+#include "platform.h"
#include "iostate.h"
static iostate_t main_state = 0;
@@ -26,7 +29,7 @@ static struct state_table io_state_table[] = {
{ STATE_LSEEK, "seek" },
{ -1, NULL } };
-static const char *
+const char *
state_to_string(iostate_t state)
{
static const char *ret = "unknown";
@@ -65,6 +68,8 @@ io_nanny_thread(void *arg)
iostate_t last_main_state = 0, current_main_state = 0;
int last_main_incarnation = 0, current_main_incarnation = 0;
int logged_incarnation = 0;
+ cman_handle_t ch = (cman_handle_t)arg;
+ int32_t whine_state;
/* Start with wherever we're at now */
pthread_mutex_lock(&state_mutex);
@@ -96,6 +101,11 @@ io_nanny_thread(void *arg)
continue;
}
+ /* Whine on CMAN api */
+ whine_state = (int32_t)current_main_state;
+ swab32(whine_state);
+ cman_send_data(ch, &whine_state, sizeof(int32_t), 0, 178, 0);
+
/* Don't log things twice */
if (logged_incarnation == current_main_incarnation)
continue;
@@ -114,7 +124,7 @@ io_nanny_thread(void *arg)
int
-io_nanny_start(int timeout)
+io_nanny_start(cman_handle_t ch, int timeout)
{
int ret;
@@ -124,7 +134,7 @@ io_nanny_start(int timeout)
qdisk_timeout = timeout;
thread_active = 1;
- ret = pthread_create(&io_nanny_tid, NULL, io_nanny_thread, NULL);
+ ret = pthread_create(&io_nanny_tid, NULL, io_nanny_thread, ch);
pthread_mutex_unlock(&state_mutex);
return ret;
diff --git a/cman/qdisk/iostate.h b/cman/qdisk/iostate.h
index 7dd7bf6..a65b1d4 100644
--- a/cman/qdisk/iostate.h
+++ b/cman/qdisk/iostate.h
@@ -11,7 +11,9 @@ typedef enum {
void io_state(iostate_t state);
-int io_nanny_start(int timeout);
+int io_nanny_start(cman_handle_t ch, int timeout);
int io_nanny_stop(void);
+const char * state_to_string(iostate_t state);
+
#endif
diff --git a/cman/qdisk/main.c b/cman/qdisk/main.c
index 9262af2..c1598fa 100644
--- a/cman/qdisk/main.c
+++ b/cman/qdisk/main.c
@@ -904,7 +904,8 @@ cman_wait(cman_handle_t ch, struct timeval *_tv)
static void
process_cman_event(cman_handle_t handle, void *private, int reason, int arg)
{
- qd_ctx *ctx = (qd_ctx *)private;
+ qd_priv_t *qp = (qd_priv_t *)private;
+ qd_ctx *ctx = qp->ctx;
switch(reason) {
case CMAN_REASON_PORTOPENED:
@@ -1915,6 +1916,33 @@ check_stop_cman(qd_ctx *ctx)
do { static int _logged=0; if (!_logged) { _logged=1; logt_print(level, fmt, ##args); } } while(0)
+static void
+qdisk_whine(cman_handle_t h, void *privdata, char *buf, int len,
+ uint8_t port, int nodeid)
+{
+ int32_t dstate;
+ qd_priv_t *qp = (qd_priv_t *)privdata;
+ node_info_t *ni = qp->ni;
+
+ if (len != sizeof(dstate)) {
+ return;
+ }
+
+ dstate = *((int32_t*)buf);
+
+ if (nodeid == (qp->ctx->qc_my_id))
+ return;
+
+ swab32(dstate);
+
+ if (dstate) {
+ logt_print(LOG_NOTICE, "qdiskd on node %d reports hung %s()\n", nodeid,
+ state_to_string(dstate));
+ ni[nodeid-1].ni_misses = 0;
+ }
+}
+
+
int
main(int argc, char **argv)
{
@@ -1928,6 +1956,7 @@ main(int argc, char **argv)
char device[128];
pid_t pid;
quorum_header_t qh;
+ qd_priv_t qp;
if (check_process_running(argv[0], &pid) && pid !=getpid()) {
printf("QDisk services already running\n");
@@ -1990,13 +2019,23 @@ main(int argc, char **argv)
/* For cman notifications we need two sockets - one for events,
one for config change callbacks */
- ch_user = cman_init(&ctx);
+ qp.ctx = &ctx;
+ qp.ni = &ni[0];
+ qp.ni_len = MAX_NODES_DISK;
+
+ ch_user = cman_init(&qp);
if (cman_start_notification(ch_user, process_cman_event) != 0) {
logt_print(LOG_CRIT, "Could not register with CMAN: %s\n",
strerror(errno));
goto out;
}
+ if (cman_start_recv_data(ch_user, qdisk_whine, 178) != 0) {
+ logt_print(LOG_CRIT, "Could not register with CMAN: %s\n",
+ strerror(errno));
+ goto out;
+ }
+
memset(&me, 0, sizeof(me));
if (cman_get_node(ch_admin, CMAN_NODEID_US, &me) < 0) {
logt_print(LOG_CRIT, "Could not determine local node ID: %s\n",
@@ -2084,7 +2123,7 @@ main(int argc, char **argv)
/* This registers the quorum device */
register_device(&ctx);
- io_nanny_start(ctx.qc_tko * ctx.qc_interval);
+ io_nanny_start(ch_user, ctx.qc_tko * ctx.qc_interval);
if (quorum_loop(&ctx, ni, MAX_NODES_DISK) == 0) {
/* Only clean up if we're exiting w/o error) */
12 years, 10 months
cluster: STABLE31 - build: fix rgmanager tarball generation
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 6707ff0f2a248dd0a05e13d9f563806cd93c6cb4
Parent: ef1c1dd818cf38d27455ce0e4678d55ae5c499eb
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu Jun 23 12:19:45 2011 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu Jun 23 12:19:45 2011 +0200
build: fix rgmanager tarball generation
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
make/release.mk | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/make/release.mk b/make/release.mk
index f4ac666..986ae71 100644
--- a/make/release.mk
+++ b/make/release.mk
@@ -102,7 +102,10 @@ $(releasearea)/$(rgmprojecttar): $(releasearea)/$(projecttar)
mv $(projectver) $(rgmprojectver) && \
cd $(rgmprojectver) && \
rm -rf bindings cman common config contrib dlm fence group \
- rgmanager/src/resources && \
+ doc/cluster_conf.html && \
+ sed -i \
+ -e 's#cluster_conf.html##g' \
+ -e 's#README.licence.*#README.licence#g' doc/Makefile && \
cd .. && \
tar cpf $(rgmprojecttar) $(rgmprojectver) && \
rm -rf $(rgmprojectver)
12 years, 10 months