From: pcaulfield@sourceware.org <pcaulfield@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster cman-kernel/src/cnxman-socket.h cman-k ...
Date: 18 Dec 2006 13:37:57 -0000 [thread overview]
Message-ID: <20061218133757.2685.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: pcaulfield at sourceware.org 2006-12-18 13:37:55
Modified files:
cman-kernel/src: cnxman-socket.h cnxman.c
cman/cman_tool : cman_tool.h join.c join_ccs.c
Log message:
Allow cluster id to ve set in CCS.
bz#219588
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman-kernel/src/cnxman-socket.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.7.2.2&r2=1.7.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman-kernel/src/cnxman.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.42.2.25&r2=1.42.2.26
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/cman_tool.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.4&r2=1.3.2.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.12.2.10&r2=1.12.2.11
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/cman/cman_tool/join_ccs.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.7.2.7&r2=1.7.2.8
--- cluster/cman-kernel/src/Attic/cnxman-socket.h 2006/03/13 11:33:30 1.7.2.2
+++ cluster/cman-kernel/src/Attic/cnxman-socket.h 2006/12/18 13:37:55 1.7.2.3
@@ -57,6 +57,7 @@
#define SIOCCLUSTER_QD_REGISTER _IOW('x', 0x0a1, struct cl_quorumdevice_info)
#define SIOCCLUSTER_QD_UNREGISTER _IO('x', 0x0a2)
#define SIOCCLUSTER_QD_POLL _IOW('x', 0x0a3, int)
+#define SIOCCLUSTER_SET_CLUSTERID _IOW('x', 0x0a4, uint16_t)
/* These were setsockopts */
#define SIOCCLUSTER_PASS_SOCKET _IOW('x', 0x0b0, struct cl_passed_sock)
--- cluster/cman-kernel/src/Attic/cnxman.c 2006/05/09 09:26:31 1.42.2.25
+++ cluster/cman-kernel/src/Attic/cnxman.c 2006/12/18 13:37:55 1.42.2.26
@@ -1703,6 +1703,17 @@
return 0;
}
+static int do_ioctl_set_clusterid(unsigned long arg)
+{
+ if (!capable(CAP_CLUSTER))
+ return -EPERM;
+ if (atomic_read(&cnxman_running))
+ return -EALREADY;
+
+ cluster_id = (uint16_t)arg;
+ return 0;
+}
+
static int do_ioctl_join_cluster(unsigned long arg)
{
struct cl_join_cluster_info join_info;
@@ -1724,7 +1735,8 @@
return -ENOTCONN;
set_votes(join_info.votes, join_info.expected_votes);
- cluster_id = generate_cluster_id(join_info.cluster_name);
+ if (!cluster_id)
+ cluster_id = generate_cluster_id(join_info.cluster_name);
strncpy(cluster_name, join_info.cluster_name, MAX_CLUSTER_NAME_LEN);
two_node = join_info.two_node;
config_version = join_info.config_version;
@@ -1925,6 +1937,13 @@
err = do_ioctl_set_nodeid(arg);
break;
+ case SIOCCLUSTER_SET_CLUSTERID:
+ if (sock->sk->sk_protocol != CLPROTO_MASTER)
+ err = -EOPNOTSUPP;
+ else
+ err = do_ioctl_set_clusterid(arg);
+ break;
+
case SIOCCLUSTER_JOIN_CLUSTER:
if (sock->sk->sk_protocol != CLPROTO_MASTER)
err = -EOPNOTSUPP;
@@ -2985,6 +3004,7 @@
acks_expected = 0;
wanted_nodeid = 0;
cur_seq = 0;
+ cluster_id = 0;
quorum_device = NULL;
}
--- cluster/cman/cman_tool/cman_tool.h 2005/03/15 10:35:06 1.3.2.4
+++ cluster/cman/cman_tool/cman_tool.h 2006/12/18 13:37:55 1.3.2.5
@@ -78,6 +78,7 @@
int force;
int verbose;
int nodeid;
+ int cluster_id;
int timeout;
unsigned int config_version;
--- cluster/cman/cman_tool/join.c 2006/03/06 10:38:42 1.12.2.10
+++ cluster/cman/cman_tool/join.c 2006/12/18 13:37:55 1.12.2.11
@@ -377,6 +377,13 @@
die("Unable to set cluster nodeid: %s", cman_error(errno));
}
+ if (comline->cluster_id) {
+ error = ioctl(cluster_sock, SIOCCLUSTER_SET_CLUSTERID,
+ comline->cluster_id);
+ if (error)
+ die("Unable to set cluster_id: %s", cman_error(errno));
+ }
+
/*
* Setup the interface/multicast
*/
--- cluster/cman/cman_tool/join_ccs.c 2005/11/24 09:34:19 1.7.2.7
+++ cluster/cman/cman_tool/join_ccs.c 2006/12/18 13:37:55 1.7.2.8
@@ -28,6 +28,7 @@
#define CONFIG_VERSION_PATH "/cluster/@config_version"
#define EXP_VOTES_PATH "/cluster/cman/@expected_votes"
#define TWO_NODE_PATH "/cluster/cman/@two_node"
+#define CLUSTER_ID_PATH "/cluster/cman/@cluster_id"
#define MCAST_ADDR_PATH "/cluster/cman/multicast/@addr"
#define PORT_PATH "/cluster/cman/@port"
#define CMAN_PREFIX "/cluster/cman/@"
@@ -524,6 +525,13 @@
}
}
+ /* cluster_id override? */
+ error = ccs_get(cd, CLUSTER_ID_PATH, &str);
+ if (!error) {
+ comline->cluster_id = atoi(str);
+ free(str);
+ }
+
get_ccs_cman_config(cd, comline);
ccs_disconnect(cd);
next reply other threads:[~2006-12-18 13:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-18 13:37 pcaulfield [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-12-18 11:37 [Cluster-devel] cluster cman-kernel/src/cnxman-socket.h cman-k pcaulfield
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061218133757.2685.qmail@sourceware.org \
--to=pcaulfield@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.