* [Cluster-devel] cluster/ccs/ccs_tool update.c
@ 2006-11-28 11:20 pcaulfield
0 siblings, 0 replies; 8+ messages in thread
From: pcaulfield @ 2006-11-28 11:20 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: pcaulfield at sourceware.org 2006-11-28 11:20:04
Modified files:
ccs/ccs_tool : update.c
Log message:
Tell cman when the config file has been updated
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&r1=1.8&r2=1.9
--- cluster/ccs/ccs_tool/update.c 2006/09/18 15:49:01 1.8
+++ cluster/ccs/ccs_tool/update.c 2006/11/28 11:20:01 1.9
@@ -222,7 +222,7 @@
ch->comm_flags= COMM_UPDATE_NOTICE;
ch->comm_payload_size = doc_size;
- handle = cman_init(NULL);
+ handle = cman_admin_init(NULL);
cluster_fd = cman_get_fd(handle);
@@ -357,7 +357,13 @@
ccs_disconnect(desc);
if (v2 == v3) {
+ cman_version_t cman_ver;
printf("Config file updated from version %d to %d\n", v1, v2);
+ cman_get_version(handle, &cman_ver);
+ cman_ver.cv_config = v2;
+ if (cman_set_version(handle, &cman_ver)) {
+ perror("Failed to tell cman of new version number");
+ }
} else {
fprintf(stderr, "Warning:: Simultaneous update requests detected.\n"
" You have lost the race.\n"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] cluster/ccs/ccs_tool update.c
@ 2006-11-28 11:23 pcaulfield
0 siblings, 0 replies; 8+ messages in thread
From: pcaulfield @ 2006-11-28 11:23 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: pcaulfield at sourceware.org 2006-11-28 11:23:17
Modified files:
ccs/ccs_tool : update.c
Log message:
Tell cman when the config file is updated
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8&r2=1.8.2.1
--- cluster/ccs/ccs_tool/update.c 2006/09/18 15:49:01 1.8
+++ cluster/ccs/ccs_tool/update.c 2006/11/28 11:23:16 1.8.2.1
@@ -222,7 +222,7 @@
ch->comm_flags= COMM_UPDATE_NOTICE;
ch->comm_payload_size = doc_size;
- handle = cman_init(NULL);
+ handle = cman_admin_init(NULL);
cluster_fd = cman_get_fd(handle);
@@ -357,7 +357,13 @@
ccs_disconnect(desc);
if (v2 == v3) {
+ cman_version_t cman_ver;
printf("Config file updated from version %d to %d\n", v1, v2);
+ cman_get_version(handle, &cman_ver);
+ cman_ver.cv_config = v2;
+ if (cman_set_version(handle, &cman_ver)) {
+ perror("Failed to tell cman of new version number");
+ }
} else {
fprintf(stderr, "Warning:: Simultaneous update requests detected.\n"
" You have lost the race.\n"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] cluster/ccs/ccs_tool update.c
@ 2006-11-30 15:57 pcaulfield
0 siblings, 0 replies; 8+ messages in thread
From: pcaulfield @ 2006-11-30 15:57 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL50
Changes by: pcaulfield at sourceware.org 2006-11-30 15:57:12
Modified files:
ccs/ccs_tool : update.c
Log message:
Tell cman when the config file has been updated
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&only_with_tag=RHEL50&r1=1.8&r2=1.8.4.1
--- cluster/ccs/ccs_tool/update.c 2006/09/18 15:49:01 1.8
+++ cluster/ccs/ccs_tool/update.c 2006/11/30 15:57:12 1.8.4.1
@@ -222,7 +222,7 @@
ch->comm_flags= COMM_UPDATE_NOTICE;
ch->comm_payload_size = doc_size;
- handle = cman_init(NULL);
+ handle = cman_admin_init(NULL);
cluster_fd = cman_get_fd(handle);
@@ -357,7 +357,13 @@
ccs_disconnect(desc);
if (v2 == v3) {
+ cman_version_t cman_ver;
printf("Config file updated from version %d to %d\n", v1, v2);
+ cman_get_version(handle, &cman_ver);
+ cman_ver.cv_config = v2;
+ if (cman_set_version(handle, &cman_ver)) {
+ perror("Failed to tell cman of new version number");
+ }
} else {
fprintf(stderr, "Warning:: Simultaneous update requests detected.\n"
" You have lost the race.\n"
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] cluster/ccs/ccs_tool update.c
@ 2007-01-26 22:13 lhh
0 siblings, 0 replies; 8+ messages in thread
From: lhh @ 2007-01-26 22:13 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2007-01-26 22:13:22
Modified files:
ccs/ccs_tool : update.c
Log message:
Fix 223519
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&r1=1.9&r2=1.10
--- cluster/ccs/ccs_tool/update.c 2006/11/28 11:20:01 1.9
+++ cluster/ccs/ccs_tool/update.c 2007/01/26 22:13:20 1.10
@@ -243,6 +243,8 @@
swab_header(ch);
for (i = 0; i < members->count; i++) {
+ if (members->nodes[i].cn_nodeid == 0)
+ continue;
fd = ccs_open(members->nodes[i], cluster_base_port, 5);
if (fd < 0) {
@@ -292,6 +294,8 @@
swab_header(ch);
for (i=0; i < members->count; i++) {
+ if (members->nodes[i].cn_nodeid == 0)
+ continue;
fd = ccs_open(members->nodes[i], cluster_base_port, 5);
if(fd < 0){
fprintf(stderr, "Unable to open connection to %s: %s\n",
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] cluster/ccs/ccs_tool update.c
@ 2007-01-26 22:14 lhh
0 siblings, 0 replies; 8+ messages in thread
From: lhh @ 2007-01-26 22:14 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: lhh at sourceware.org 2007-01-26 22:14:25
Modified files:
ccs/ccs_tool : update.c
Log message:
Fix 223519
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.1&r2=1.8.2.2
--- cluster/ccs/ccs_tool/update.c 2006/11/28 11:23:16 1.8.2.1
+++ cluster/ccs/ccs_tool/update.c 2007/01/26 22:14:22 1.8.2.2
@@ -243,6 +243,8 @@
swab_header(ch);
for (i = 0; i < members->count; i++) {
+ if (members->nodes[i].cn_nodeid == 0)
+ continue;
fd = ccs_open(members->nodes[i], cluster_base_port, 5);
if (fd < 0) {
@@ -292,6 +294,8 @@
swab_header(ch);
for (i=0; i < members->count; i++) {
+ if (members->nodes[i].cn_nodeid == 0)
+ continue;
fd = ccs_open(members->nodes[i], cluster_base_port, 5);
if(fd < 0){
fprintf(stderr, "Unable to open connection to %s: %s\n",
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] cluster/ccs/ccs_tool update.c
@ 2007-05-03 9:25 fabbione
0 siblings, 0 replies; 8+ messages in thread
From: fabbione @ 2007-05-03 9:25 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: fabbione at sourceware.org 2007-05-03 09:25:57
Modified files:
ccs/ccs_tool : update.c
Log message:
Remove dead code
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&r1=1.11&r2=1.12
--- cluster/ccs/ccs_tool/update.c 2007/05/03 09:06:39 1.11
+++ cluster/ccs/ccs_tool/update.c 2007/05/03 09:25:57 1.12
@@ -35,16 +35,10 @@
static member_list_t *get_member_list(cman_handle_t handle);
static void free_member_list(member_list_t *list);
-static char *member_id_to_name(member_list_t *list, int node);
-static int member_name_to_id(member_list_t *list, char *name);
-static int member_addr_to_id(member_list_t *list, struct sockaddr *addr);
-static int member_online_node(member_list_t *list, int node);
-static int member_online_name(member_list_t *list, char *name);
static int select_retry(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *xfds,
struct timeval *timeout);
-static ssize_t write_retry(int fd, void *buf, int count, struct timeval *timeout);
static ssize_t read_retry(int fd, void *buf, int count, struct timeval *timeout);
static int ccs_open(cman_node_t node, uint16_t baseport, int timeout);
@@ -447,78 +441,6 @@
}
-static char *member_id_to_name(member_list_t *list, int node)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (list->nodes[i].cn_nodeid == node) {
- return list->nodes[i].cn_name;
- }
- }
-
- return NULL;
-}
-
-
-static int member_name_to_id(member_list_t *list, char *name)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (!strcasecmp(list->nodes[i].cn_name, name)) {
- return list->nodes[i].cn_nodeid;
- }
- }
-
- return 0;
-}
-
-
-static int member_addr_to_id(member_list_t *list, struct sockaddr *addr)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (memcmp(&list->nodes[i].cn_address.cna_address, addr,
- sizeof(struct sockaddr))) {
-
- return list->nodes[i].cn_nodeid;
- }
- }
-
- return -1;
-}
-
-
-static int member_online_node(member_list_t *list, int node)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (list->nodes[i].cn_nodeid == node) {
- return list->nodes[i].cn_member;
- }
- }
-
- return 0;
-}
-
-
-static int member_online_name(member_list_t *list, char *name)
-{
- int i;
-
- for (i = 0; i < list->count; i++) {
- if (!strcasecmp(list->nodes[i].cn_name, name)) {
- return list->nodes[i].cn_member;
- }
- }
-
- return 0;
-}
-
-
static int select_retry(int max_fd, fd_set *rfds, fd_set *wfds, fd_set *xfds,
struct timeval *timeout)
{
@@ -535,68 +457,6 @@
}
-static ssize_t write_retry(int fd, void *buf, int count, struct timeval *timeout)
-{
- int n, total = 0, remain = count, rv = 0;
- fd_set wfds, xfds;
-
- while (total < count)
- {
- /* Create the write FD set of 1... */
- FD_ZERO(&wfds);
- FD_SET(fd, &wfds);
- FD_ZERO(&xfds);
- FD_SET(fd, &xfds);
-
- /* wait for the fd to be available for writing */
- rv = select_retry(fd + 1, NULL, &wfds, &xfds, timeout);
- if (rv == -1) {
- return -1;
- }
- else if (rv == 0) {
- errno = ETIMEDOUT;
- return -1;
- }
-
- if (FD_ISSET(fd, &xfds)) {
- errno = EPIPE;
- return -1;
- }
-
- /*
- * Attempt to write to fd
- */
- n = write(fd, buf + (off_t) total, remain);
-
- /*
- * When we know our fd was select()ed and we receive 0 bytes
- * when we write, the fd was closed.
- */
- if ((n == 0) && (rv == 1)) {
- errno = EPIPE;
- return -1;
- }
-
- if (n == -1) {
- if ((errno == EAGAIN) || (errno == EINTR)) {
- /*
- * Not ready?
- */
- continue;
- }
-
- /* Other errors: EIO, EINVAL, etc */
- return -1;
- }
-
- total += n;
- remain -= n;
- }
-
- return total;
-}
-
-
static ssize_t read_retry(int fd, void *buf, int count, struct timeval *timeout)
{
int n, total = 0, remain = count, rv = 0;
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] cluster/ccs/ccs_tool update.c
@ 2007-06-19 15:51 lhh
0 siblings, 0 replies; 8+ messages in thread
From: lhh @ 2007-06-19 15:51 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: lhh at sourceware.org 2007-06-19 15:51:37
Modified files:
ccs/ccs_tool : update.c
Log message:
Resolves: 244867
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.8.2.2&r2=1.8.2.3
--- cluster/ccs/ccs_tool/update.c 2007/01/26 22:14:22 1.8.2.2
+++ cluster/ccs/ccs_tool/update.c 2007/06/19 15:51:37 1.8.2.3
@@ -245,6 +245,9 @@
for (i = 0; i < members->count; i++) {
if (members->nodes[i].cn_nodeid == 0)
continue;
+ if (members->nodes[i].cn_member == 0)
+ continue;
+
fd = ccs_open(members->nodes[i], cluster_base_port, 5);
if (fd < 0) {
@@ -296,6 +299,9 @@
for (i=0; i < members->count; i++) {
if (members->nodes[i].cn_nodeid == 0)
continue;
+ if (members->nodes[i].cn_member == 0)
+ continue;
+
fd = ccs_open(members->nodes[i], cluster_base_port, 5);
if(fd < 0){
fprintf(stderr, "Unable to open connection to %s: %s\n",
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Cluster-devel] cluster/ccs/ccs_tool update.c
@ 2007-06-19 18:08 lhh
0 siblings, 0 replies; 8+ messages in thread
From: lhh @ 2007-06-19 18:08 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2007-06-19 18:08:01
Modified files:
ccs/ccs_tool : update.c
Log message:
Fix update failure if node was fenced
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/ccs/ccs_tool/update.c.diff?cvsroot=cluster&r1=1.12&r2=1.13
--- cluster/ccs/ccs_tool/update.c 2007/05/03 09:25:57 1.12
+++ cluster/ccs/ccs_tool/update.c 2007/06/19 18:08:01 1.13
@@ -244,6 +244,9 @@
for (i = 0; i < members->count; i++) {
if (members->nodes[i].cn_nodeid == 0)
continue;
+ if (members->nodes[i].cn_member == 0)
+ continue;
+
fd = ccs_open(members->nodes[i], cluster_base_port, 5);
if (fd < 0) {
@@ -295,6 +298,9 @@
for (i=0; i < members->count; i++) {
if (members->nodes[i].cn_nodeid == 0)
continue;
+ if (members->nodes[i].cn_member == 0)
+ continue;
+
fd = ccs_open(members->nodes[i], cluster_base_port, 5);
if(fd < 0){
fprintf(stderr, "Unable to open connection to %s: %s\n",
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-06-19 18:08 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-19 18:08 [Cluster-devel] cluster/ccs/ccs_tool update.c lhh
-- strict thread matches above, loose matches on Subject: below --
2007-06-19 15:51 lhh
2007-05-03 9:25 fabbione
2007-01-26 22:14 lhh
2007-01-26 22:13 lhh
2006-11-30 15:57 pcaulfield
2006-11-28 11:23 pcaulfield
2006-11-28 11:20 pcaulfield
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).