Hello community,

here is the log from the commit of package corosync for openSUSE:Factory 
checked in at 2014-01-30 14:54:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/corosync (Old)
 and      /work/SRC/openSUSE:Factory/.corosync.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "corosync"

Changes:
--------
--- /work/SRC/openSUSE:Factory/corosync/corosync.changes        2014-01-07 
16:15:31.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.corosync.new/corosync.changes   2014-01-30 
14:54:25.000000000 +0100
@@ -1,0 +2,22 @@
+Tue Jan 21 07:48:22 UTC 2014 - x...@suse.com
+
+- Update to corosync 2.3.3
+- Properly check result of symlink
+- Fix cppchecks warning
+- Close devnull file handler
+- votequorum: Add missing man pages
+- totem: Drop invalid join msg in operational state
+- systemd unit: Make sure network is really up
+- votequorum: Improve/add documentation for quorum device API
+- votequorum: Add persistent expected_votes tracking.
+- Upstream version cs: 45dd9861ff78362068d214cf520006a1b26376cd 
+
+-------------------------------------------------------------------
+Thu Jan  9 09:14:50 UTC 2014 - x...@suse.com
+
+- Add patch to fix cts api wrong issue 
+  + corosync-cts-api-error.patch
+- Add patch to change default settings of conf.example
+  + corosync-conf-example.patch 
+
+-------------------------------------------------------------------
@@ -13 +35 @@
-- Upsteam version cs: 7014f10123a634cf026491edc9a09d6044106116
+- Upstream version cs: 7014f10123a634cf026491edc9a09d6044106116

Old:
----
  corosync-2.3.2.tar.gz

New:
----
  corosync-2.3.3.tar.gz
  corosync-conf-example.patch
  corosync-cts-api-error.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ corosync.spec ++++++
--- /var/tmp/diff_new_pack.EceRDm/_old  2014-01-30 14:54:26.000000000 +0100
+++ /var/tmp/diff_new_pack.EceRDm/_new  2014-01-30 14:54:26.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package corosync
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -44,12 +44,14 @@
 Summary:        The Corosync Cluster Engine and Application Programming 
Interfaces
 License:        BSD-3-Clause
 Group:          Productivity/Clustering/HA
-Version:        2.3.2
+Version:        2.3.3
 Release:        0
 Url:            http://www.corosync.org
 Source0:        %{name}-%{version}.tar.gz
 Source2:        baselibs.conf
 Patch1:         corosync-init-lockfile-path-error.patch
+Patch2:         corosync-cts-api-error.patch
+Patch3:         corosync-conf-example.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 # openais is indeed gone and should be uninstalled. No, we do not
 # provide openais on purpose, the package has been deleted.
@@ -96,6 +98,8 @@
 %prep
 %setup -q -n %{name}-%{version}
 %patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 #%if 0%{?buildtrunk} == 1

++++++ corosync-2.3.2.tar.gz -> corosync-2.3.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/exec/cmap.c 
new/corosync-2.3.3/exec/cmap.c
--- old/corosync-2.3.2/exec/cmap.c      2013-11-26 15:39:34.000000000 +0100
+++ new/corosync-2.3.3/exec/cmap.c      2014-01-14 11:24:31.000000000 +0100
@@ -597,8 +597,8 @@
        struct res_lib_cmap_iter_next res_lib_cmap_iter_next;
        cs_error_t ret;
        icmap_iter_t *iter;
-       size_t value_len;
-       icmap_value_types_t type;
+       size_t value_len = 0;
+       icmap_value_types_t type = 0;
        const char *res = NULL;
        struct cmap_conn_info *conn_info = (struct cmap_conn_info 
*)api->ipc_private_data_get (conn);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/exec/coroparse.c 
new/corosync-2.3.3/exec/coroparse.c
--- old/corosync-2.3.2/exec/coroparse.c 2013-11-26 15:39:34.000000000 +0100
+++ new/corosync-2.3.3/exec/coroparse.c 2014-01-14 11:24:31.000000000 +0100
@@ -507,6 +507,7 @@
                        }
 
                        if ((strcmp(path, "quorum.two_node") == 0) ||
+                           (strcmp(path, "quorum.expected_votes_tracking") == 
0) ||
                            (strcmp(path, "quorum.allow_downscale") == 0) ||
                            (strcmp(path, "quorum.wait_for_all") == 0) ||
                            (strcmp(path, "quorum.auto_tie_breaker") == 0) ||
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/exec/main.c 
new/corosync-2.3.3/exec/main.c
--- old/corosync-2.3.2/exec/main.c      2013-11-26 15:39:34.000000000 +0100
+++ new/corosync-2.3.3/exec/main.c      2014-01-14 11:24:31.000000000 +0100
@@ -209,7 +209,10 @@
        qb_log_blackbox_write_to_file(fname);
 
        unlink(LOCALSTATEDIR "/lib/corosync/fdata");
-       symlink(fname, LOCALSTATEDIR "/lib/corosync/fdata");
+       if (symlink(fname, LOCALSTATEDIR "/lib/corosync/fdata") == -1) {
+               log_printf(LOGSYS_LEVEL_ERROR, "Can't create symlink to '%s' 
for corosync blackbox file '%s'",
+                   fname, LOCALSTATEDIR "/lib/corosync/fdata");
+       }
 }
 
 static void unlink_all_completed (void)
@@ -431,8 +434,10 @@
 
        if (dup2(devnull, 0) < 0 || dup2(devnull, 1) < 0
            || dup2(devnull, 2) < 0) {
+               close(devnull);
                corosync_exit_error (COROSYNC_DONE_STD_TO_NULL_REDIR);
        }
+       close(devnull);
 }
 
 static void corosync_mlockall (void)
@@ -560,8 +565,8 @@
        void *user_data)
 {
        int res;
-       int ring_no;
-       int member_no;
+       unsigned int ring_no;
+       unsigned int member_no;
        struct totem_ip_address member;
        int add_new_member = 0;
        int remove_old_member = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/exec/totemconfig.c 
new/corosync-2.3.3/exec/totemconfig.c
--- old/corosync-2.3.2/exec/totemconfig.c       2013-11-26 15:39:34.000000000 
+0100
+++ new/corosync-2.3.3/exec/totemconfig.c       2014-01-14 11:24:31.000000000 
+0100
@@ -292,7 +292,7 @@
        icmap_iter_t iter;
        const char *iter_key;
        int res = 0;
-       int node_pos;
+       unsigned int node_pos;
        int local_node_pos = -1;
        struct totem_ip_address bind_addr;
        int interface_up, interface_num;
@@ -343,7 +343,7 @@
        icmap_iter_t iter, iter2;
        const char *iter_key, *iter_key2;
        int res = 0;
-       int node_pos;
+       unsigned int node_pos;
        char tmp_key[ICMAP_KEYNAME_MAXLEN];
        char tmp_key2[ICMAP_KEYNAME_MAXLEN];
        char *node_addr_str;
@@ -394,7 +394,7 @@
        icmap_iter_t iter;
        const char *iter_key;
        int res = 0;
-       int node_pos;
+       unsigned int node_pos;
        char tmp_key[ICMAP_KEYNAME_MAXLEN];
        char tmp_key2[ICMAP_KEYNAME_MAXLEN];
        char *node_addr_str;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/exec/totemsrp.c 
new/corosync-2.3.3/exec/totemsrp.c
--- old/corosync-2.3.2/exec/totemsrp.c  2013-11-26 15:39:34.000000000 +0100
+++ new/corosync-2.3.3/exec/totemsrp.c  2014-01-14 11:24:31.000000000 +0100
@@ -4400,6 +4400,36 @@
        srp_addr_copy_endian_convert (&out->system_from, &in->system_from);
 }
 
+static int ignore_join_under_operational (
+       struct totemsrp_instance *instance,
+       const struct memb_join *memb_join)
+{
+       struct srp_addr *proc_list;
+       struct srp_addr *failed_list;
+       unsigned long long ring_seq;
+
+       proc_list = (struct srp_addr *)memb_join->end_of_memb_join;
+       failed_list = proc_list + memb_join->proc_list_entries;
+       ring_seq = memb_join->ring_seq;
+
+       if (memb_set_subset (&instance->my_id, 1,
+           failed_list, memb_join->failed_list_entries)) {
+               return (1);
+       }
+
+       /*
+        * In operational state, my_proc_list is exactly the same as
+        * my_memb_list.
+        */
+       if ((memb_set_subset (&memb_join->system_from, 1,
+           instance->my_memb_list, instance->my_memb_entries)) &&
+           (ring_seq < instance->my_ring_id.seq)) {
+               return (1);
+       }
+
+       return (0);
+}
+
 static int message_handler_memb_join (
        struct totemsrp_instance *instance,
        const void *msg,
@@ -4430,7 +4460,9 @@
        }
        switch (instance->memb_state) {
                case MEMB_STATE_OPERATIONAL:
-                       memb_join_process (instance, memb_join);
+                       if (!ignore_join_under_operational (instance, 
memb_join)) {
+                               memb_join_process (instance, memb_join);
+                       }
                        break;
 
                case MEMB_STATE_GATHER:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/exec/votequorum.c 
new/corosync-2.3.3/exec/votequorum.c
--- old/corosync-2.3.2/exec/votequorum.c        2013-11-26 15:39:34.000000000 
+0100
+++ new/corosync-2.3.3/exec/votequorum.c        2014-01-14 11:24:31.000000000 
+0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009-2012 Red Hat, Inc.
+ * Copyright (c) 2009-2014 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -36,7 +36,10 @@
 #include <config.h>
 
 #include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <stdint.h>
+#include <unistd.h>
 
 #include <qb/qbipc_common.h>
 
@@ -85,6 +88,10 @@
 static uint8_t allow_downscale = 0;
 static uint32_t ev_barrier = 0;
 
+static uint8_t ev_tracking = 0;
+static uint32_t ev_tracking_barrier = 0;
+static int ev_tracking_fd = -1;
+
 /*
  * votequorum_exec defines/structs/forward definitions
  */
@@ -589,6 +596,47 @@
        LEAVE();
 }
 
+/*
+ * load/save are copied almost pristine from totemsrp,c
+ */
+static int load_ev_tracking_barrier(void)
+{
+       int res = 0;
+       char filename[PATH_MAX];
+
+       ENTER();
+
+       snprintf(filename, sizeof(filename) - 1, LOCALSTATEDIR 
"/lib/corosync/ev_tracking");
+
+       ev_tracking_fd = open(filename, O_RDWR, 0700);
+       if (ev_tracking_fd != -1) {
+               res = read (ev_tracking_fd, &ev_tracking_barrier, 
sizeof(uint32_t));
+               if (res == sizeof (uint32_t)) {
+                       LEAVE();
+                       return 0;
+               }
+       }
+
+       ev_tracking_barrier = 0;
+       umask(0);
+       ev_tracking_fd = open (filename, O_CREAT|O_RDWR, 0700);
+       if (ev_tracking_fd != -1) {
+               res = write (ev_tracking_fd, &ev_tracking_barrier, sizeof 
(uint32_t));
+               if ((res == -1) || (res != sizeof (uint32_t))) {
+                       log_printf(LOGSYS_LEVEL_WARNING,
+                                  "Unable to write to %s", filename);
+               }
+               LEAVE();
+               return 0;
+       }
+       log_printf(LOGSYS_LEVEL_WARNING,
+                  "Unable to create %s file", filename);
+
+       LEAVE();
+
+       return -1;
+}
+
 static void update_wait_for_all_status(uint8_t wfa_status)
 {
        ENTER(); 
@@ -644,6 +692,32 @@
        LEAVE();
 }
 
+static void update_ev_tracking_barrier(uint32_t ev_t_barrier)
+{
+       int res;
+
+       ENTER();
+
+       ev_tracking_barrier = ev_t_barrier;
+       icmap_set_uint32("runtime.votequorum.ev_tracking_barrier", 
ev_tracking_barrier);
+
+       if (lseek (ev_tracking_fd, 0, SEEK_SET) != 0) {
+               log_printf(LOGSYS_LEVEL_WARNING,
+                          "Unable to update ev_tracking_barrier on disk 
data!!!");
+               LEAVE();
+               return;
+       }
+
+       res = write (ev_tracking_fd, &ev_tracking_barrier, sizeof (uint32_t));
+       if (res != sizeof (uint32_t)) {
+               log_printf(LOGSYS_LEVEL_WARNING,
+                          "Unable to update ev_tracking_barrier on disk 
data!!!");
+       }
+       fdatasync(ev_tracking_fd);
+
+       LEAVE();
+}
+
 /*
  * quorum calculation core bits
  */
@@ -854,6 +928,11 @@
                votequorum_exec_send_expectedvotes_notification();
        }
 
+       if ((ev_tracking) &&
+           (us->expected_votes > ev_tracking_barrier)) {
+               update_ev_tracking_barrier(us->expected_votes);
+       }
+
        quorum = calculate_quorum(allow_decrease, cluster_members, 
&total_votes);
        are_we_quorate(total_votes);
 
@@ -1022,6 +1101,21 @@
                icmap_get_uint8("quorum.auto_tie_breaker", &auto_tie_breaker);
                icmap_get_uint8("quorum.last_man_standing", &last_man_standing);
                icmap_get_uint32("quorum.last_man_standing_window", 
&last_man_standing_window);
+               icmap_get_uint8("quorum.expected_votes_tracking", &ev_tracking);
+
+               /* allow_downscale requires ev_tracking */
+               if (allow_downscale) {
+                   ev_tracking = 1;
+               }
+
+               if (ev_tracking) {
+                   if (load_ev_tracking_barrier() < 0) {
+                       LEAVE();
+                       return ((char *)"Unable to load ev_tracking file!");
+                   }
+                   update_ev_tracking_barrier(ev_tracking_barrier);
+               }
+
        }
 
        /*
@@ -1144,6 +1238,11 @@
        /*
         * set this node votes and expected_votes
         */
+       log_printf(LOGSYS_LEVEL_DEBUG, "ev_tracking=%d, ev_tracking_barrier = 
%d: expected_votes = %d\n", ev_tracking, ev_tracking_barrier, expected_votes);
+
+       if (ev_tracking) {
+               expected_votes = ev_tracking_barrier;
+       }
 
        if (have_nodelist) {
                us->votes = node_votes;
@@ -1666,7 +1765,7 @@
                us->expected_votes = req_exec_quorum_nodeinfo->expected_votes;
        }
 
-       if (node->flags & NODE_FLAGS_QUORATE) {
+       if (node->flags & NODE_FLAGS_QUORATE || (ev_tracking)) {
                node->expected_votes = req_exec_quorum_nodeinfo->expected_votes;
        } else {
                node->expected_votes = us->expected_votes;
@@ -1683,7 +1782,6 @@
        }
 
 recalculate:
-
        if ((new_node) ||
            (nodeid == us->node_id) ||
            (node->flags & NODE_FLAGS_FIRST) || 
@@ -1739,6 +1837,9 @@
                }
                votequorum_exec_send_expectedvotes_notification();
                update_ev_barrier(req_exec_quorum_reconfigure->value);
+               if (ev_tracking) {
+                   us->expected_votes = max(us->expected_votes, 
ev_tracking_barrier);
+               }
                recalculate_quorum(1, 0);  /* Allow decrease */
                break;
 
@@ -1772,6 +1873,11 @@
                ret = votequorum_exec_send_nodeinfo(us->node_id);
        }
 
+       if ((ev_tracking) && (ev_tracking_fd != -1)) {
+           close(ev_tracking_fd);
+       }
+
+
        LEAVE();
        return ret;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/init/corosync.service.in 
new/corosync-2.3.3/init/corosync.service.in
--- old/corosync-2.3.2/init/corosync.service.in 2013-11-26 15:39:34.000000000 
+0100
+++ new/corosync-2.3.3/init/corosync.service.in 2014-01-14 11:24:31.000000000 
+0100
@@ -1,8 +1,8 @@
 [Unit]
 Description=Corosync Cluster Engine
 ConditionKernelCommandLine=!nocluster
-Requires=network.target
-After=network.target
+Requires=network-online.target
+After=network-online.target
 
 [Service]
 ExecStart=@INITWRAPPERSDIR@/corosync start
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/man/Makefile.am 
new/corosync-2.3.3/man/Makefile.am
--- old/corosync-2.3.2/man/Makefile.am  2013-11-26 15:39:34.000000000 +0100
+++ new/corosync-2.3.3/man/Makefile.am  2014-01-14 11:24:31.000000000 +0100
@@ -1,5 +1,5 @@
 # Copyright (c) 2004 MontaVista Software, Inc.
-# Copyright (c) 2009, 2012 Red Hat, Inc.
+# Copyright (c) 2009, 2012, 2014 Red Hat, Inc.
 #
 # Authors: Steven Dake (sd...@redhat.com)
 #          Fabio M. Di Nitto (fdini...@redhat.com)
@@ -77,6 +77,11 @@
                          votequorum_setvotes.3 \
                          votequorum_trackstart.3 \
                          votequorum_trackstop.3 \
+                         votequorum_qdevice_register.3 \
+                         votequorum_qdevice_unregister.3 \
+                         votequorum_qdevice_update.3 \
+                         votequorum_qdevice_master_wins.3 \
+                         votequorum_qdevice_poll.3 \
                          sam_data_getsize.3 \
                          sam_data_restore.3 \
                          sam_data_store.3 \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/man/votequorum.5 
new/corosync-2.3.3/man/votequorum.5
--- old/corosync-2.3.2/man/votequorum.5 2013-11-26 15:39:34.000000000 +0100
+++ new/corosync-2.3.3/man/votequorum.5 2014-01-14 11:24:31.000000000 +0100
@@ -1,5 +1,5 @@
 .\"/*
-.\" * Copyright (c) 2012 Red Hat, Inc.
+.\" * Copyright (c) 2012-2014 Red Hat, Inc.
 .\" *
 .\" * All rights reserved.
 .\" *
@@ -317,6 +317,27 @@
     allow_downscale: 1
 }
 .fi
+allow_downscale implicitly enabled EVT (see below).
+.PP
+.B expected_votes_tracking: 1
+.PP
+Enables Expected Votes Tracking (EVT) feature (default: 0).
+.PP
+Expected Votes Tracking stores the highest-seen value of expected votes on 
disk and uses
+that as the minimum value for expected votes in the absence of any higher 
authority (eg 
+a current quorate cluster). This is useful for when a group of nodes becomes 
detached from
+the main cluster and after a restart could have enough votes to provide 
quorum, which can 
+happen after using allow_downscale. 
+.PP
+Note that even if the in-memory version of expected_votes is reduced, eg by 
removing nodes
+or using corosync-quorumtool, the stored value will still be the highest value 
seen - it
+never gets reduced.
+.PP
+The value is held in the file /var/lib/corosync/ev_tracking which can be 
deleted if you 
+really do need to reduce the expected votes for any reason, like the node has 
been moved 
+to a different cluster.
+.PP
+.fi
 .PP
 .SH VARIOUS NOTES
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/corosync-2.3.2/man/votequorum_qdevice_master_wins.3.in 
new/corosync-2.3.3/man/votequorum_qdevice_master_wins.3.in
--- old/corosync-2.3.2/man/votequorum_qdevice_master_wins.3.in  1970-01-01 
01:00:00.000000000 +0100
+++ new/corosync-2.3.3/man/votequorum_qdevice_master_wins.3.in  2014-01-14 
11:24:31.000000000 +0100
@@ -0,0 +1,77 @@
+.\"/*
+.\" * Copyright (c) 2014 Red Hat, Inc.
+.\" *
+.\" * All rights reserved.
+.\" *
+.\" * Author: Christine Caulfield <ccaul...@redhat.com>
+.\" *
+.\" * This software licensed under BSD license, the text of which follows:
+.\" *
+.\" * Redistribution and use in source and binary forms, with or without
+.\" * modification, are permitted provided that the following conditions are 
met:
+.\" *
+.\" * - Redistributions of source code must retain the above copyright notice,
+.\" *   this list of conditions and the following disclaimer.
+.\" * - Redistributions in binary form must reproduce the above copyright 
notice,
+.\" *   this list of conditions and the following disclaimer in the 
documentation
+.\" *   and/or other materials provided with the distribution.
+.\" * - Neither the name of the MontaVista Software, Inc. nor the names of its
+.\" *   contributors may be used to endorse or promote products derived from 
this
+.\" *   software without specific prior written permission.
+.\" *
+.\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 
IS"
+.\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
PURPOSE
+.\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+.\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+.\" * THE POSSIBILITY OF SUCH DAMAGE.
+.\" */
+.TH VOTEQUORUM_QDEVICE_MASTER_WINS 3 @BUILDDATE@ "corosync Man Page" "Corosync 
Cluster Engine Programmer's Manual"
+.SH NAME
+votequorum_qdevice_master_wins \- Sets or clears quorum device master_wins flag
+.SH SYNOPSIS
+.B #include <corosync/votequorum.h>
+.sp
+.BI "int votequorum_qdevice_master_wins(votequorum_handle_t " handle " const 
char " name ", unsigned int " allow ");"
+.SH DESCRIPTION
+The
+.B votequorum_qdevice_master_wins
+informs votequorum whether or not the currently registered qdevice subsystem 
supports 'master_wins' mode (default 0).
+This mode allows the qdevice to effectively take over the quorum calculations 
of votequorum. Any node with an active
+qdevice that also has master_wins set becomes quorate regardless of the node 
votes of the cluster. It is left up to the 
+qdevice subsystem itself (not part of votequorum) to communicate across the 
nodes or otherwise provide some system of
+deciding which nodes will be part of the quorate cluster, if any. eg They may 
be the set of nodes that has access to
+a quorum disk.
+.br
+.B name
+The name of the currently registered quorum device on this node. This must 
match the existing name known to votequorum.
+.br
+.B allow
+0 (the default) means that master_wins is not active on this node. 1 means 
that master_wins is active on this node.
+.SH RETURN VALUE
+This call returns the CS_OK value if successful, otherwise an error is 
returned.
+.PP
+.SH ERRORS
+@COMMONIPCERRORS@
+.SH "SEE ALSO"
+.BR votequorum_overview (8),
+.BR votequorum_initialize (3),
+.BR votequorum_finalize (3),
+.BR votequorum_getinfo (3),
+.BR votequorum_trackstart (3),
+.BR votequorum_trackstop (3),
+.BR votequorum_fd_get (3),
+.BR votequorum_dispatch (3),
+.BR votequorum_context_set (3),
+.BR votequorum_context_get (3),
+.BR votequorum_setexpected (3),
+.BR votequorum_setvotes (3),
+.BR votequorum_qdevice_register (3),
+.BR votequorum_qdevice_poll (3),
+.BR votequorum_qdevice_update (3),
+.PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/man/votequorum_qdevice_poll.3.in 
new/corosync-2.3.3/man/votequorum_qdevice_poll.3.in
--- old/corosync-2.3.2/man/votequorum_qdevice_poll.3.in 2013-11-26 
15:39:34.000000000 +0100
+++ new/corosync-2.3.3/man/votequorum_qdevice_poll.3.in 2014-01-14 
11:24:31.000000000 +0100
@@ -1,5 +1,5 @@
 .\"/*
-.\" * Copyright (c) 2009,2012 Red Hat, Inc.
+.\" * Copyright (c) 2009,2012,2014 Red Hat, Inc.
 .\" *
 .\" * All rights reserved.
 .\" *
@@ -37,7 +37,7 @@
 .SH SYNOPSIS
 .B #include <corosync/votequorum.h>
 .sp
-.BI "int votequorum_qdevice_poll(votequorum_handle_t " handle ", unsigned int 
" cast_vote ");"
+.BI "int votequorum_qdevice_poll(votequorum_handle_t " handle ", const char * 
" name ", unsigned int " cast_vote ");"
 .SH DESCRIPTION
 The
 .B votequorum_qdevice_poll
@@ -48,9 +48,9 @@
 This routine should be called at regular intervals to ensure that the device 
status
 is always known to votequorum. If
 .B votequorum_qdevice_poll
-is not called after (default) 10 seconds then the device will be deeded to be 
dead and
+is not called for (default) 10 seconds then the device will be deemed to be 
dead and
 its votes removed from the cluster. This does not unregister the device.
-The default poll time can be changed by setting the object database variable
+The default poll time can be changed by setting the cmap variable
 quorum.quorumdev_poll.
 .SH RETURN VALUE
 This call returns the CS_OK value if successful, otherwise an error is 
returned.
@@ -72,5 +72,6 @@
 .BR votequorum_setvotes (3),
 .BR votequorum_qdevice_register (3),
 .BR votequorum_qdevice_unregister (3),
-.BR votequorum_qdevice_get_info (3)
+.BR votequorum_qdevice_update (3),
+.BR votequorum_qdevice_master_wins (3),
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/man/votequorum_qdevice_register.3.in 
new/corosync-2.3.3/man/votequorum_qdevice_register.3.in
--- old/corosync-2.3.2/man/votequorum_qdevice_register.3.in     2013-11-26 
15:39:34.000000000 +0100
+++ new/corosync-2.3.3/man/votequorum_qdevice_register.3.in     2014-01-14 
11:24:31.000000000 +0100
@@ -1,5 +1,5 @@
 .\"/*
-.\" * Copyright (c) 2009,2012 Red Hat, Inc.
+.\" * Copyright (c) 2009,2012,2014 Red Hat, Inc.
 .\" *
 .\" * All rights reserved.
 .\" *
@@ -37,7 +37,7 @@
 .SH SYNOPSIS
 .B #include <corosync/votequorum.h>
 .sp
-.BI "int votequorum_qdevice_register(votequorum_handle_t " handle ", char * " 
name ", unsigned int " votes ");"
+.BI "int votequorum_qdevice_register(votequorum_handle_t " handle ", const 
char * " name ");"
 .SH DESCRIPTION
 The
 .B votequorum_qdevice_register
@@ -48,7 +48,14 @@
 This call creates the device but does not mark it active.
 .B votequorum_qdevice_poll
 must be called for the votes to be included in the quorum calculation.
-.BR
+.br
+.B name
+is string containing an informative name for the quorum device. It is simply 
stored
+by votequorum and used in the display of corosync-quorumtool, it can be a 
maximum of 254 characters.
+.br
+The number of votes contributed by the quorum device is already known to 
votequorum, it is set in cmap
+quorum.device.votes and not by the device.
+.br
 Note that it is the responsibility of the quorum device subsystem (not 
provided as part of votequorum)
 to keep all nodes informed of the quorum device status.
 .SH RETURN VALUE
@@ -71,5 +78,6 @@
 .BR votequorum_setvotes (3),
 .BR votequorum_qdevice_unregister (3),
 .BR votequorum_qdevice_poll (3),
-.BR votequorum_qdevice_get_info (3)
+.BR votequorum_qdevice_update (3),
+.BR votequorum_qdevice_master_wins (3)
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/corosync-2.3.2/man/votequorum_qdevice_unregister.3.in 
new/corosync-2.3.3/man/votequorum_qdevice_unregister.3.in
--- old/corosync-2.3.2/man/votequorum_qdevice_unregister.3.in   2013-11-26 
15:39:34.000000000 +0100
+++ new/corosync-2.3.3/man/votequorum_qdevice_unregister.3.in   2014-01-14 
11:24:31.000000000 +0100
@@ -1,5 +1,5 @@
 .\"/*
-.\" * Copyright (c) 2009,2012 Red Hat, Inc.
+.\" * Copyright (c) 2009,2012,2014 Red Hat, Inc.
 .\" *
 .\" * All rights reserved.
 .\" *
@@ -37,7 +37,7 @@
 .SH SYNOPSIS
 .B #include <corosync/votequorum.h>
 .sp
-.BI "int votequorum_qdevice_unregister(votequorum_handle_t " handle ");"
+.BI "int votequorum_qdevice_unregister(votequorum_handle_t " handle ", const 
char * " name ");"
 .SH DESCRIPTION
 The
 .B votequorum_qdevice_unregister
@@ -63,5 +63,6 @@
 .BR votequorum_setvotes (3),
 .BR votequorum_qdevice_register (3),
 .BR votequorum_qdevice_poll (3),
-.BR votequorum_qdevice_get_info (3)
+.BR votequorum_qdevice_update (3),
+.BR votequorum_qdevice_master_wins (3)
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/man/votequorum_qdevice_update.3.in 
new/corosync-2.3.3/man/votequorum_qdevice_update.3.in
--- old/corosync-2.3.2/man/votequorum_qdevice_update.3.in       1970-01-01 
01:00:00.000000000 +0100
+++ new/corosync-2.3.3/man/votequorum_qdevice_update.3.in       2014-01-14 
11:24:31.000000000 +0100
@@ -0,0 +1,69 @@
+.\"/*
+.\" * Copyright (c) 2014 Red Hat, Inc.
+.\" *
+.\" * All rights reserved.
+.\" *
+.\" * Author: Christine Caulfield <ccaul...@redhat.com>
+.\" *
+.\" * This software licensed under BSD license, the text of which follows:
+.\" *
+.\" * Redistribution and use in source and binary forms, with or without
+.\" * modification, are permitted provided that the following conditions are 
met:
+.\" *
+.\" * - Redistributions of source code must retain the above copyright notice,
+.\" *   this list of conditions and the following disclaimer.
+.\" * - Redistributions in binary form must reproduce the above copyright 
notice,
+.\" *   this list of conditions and the following disclaimer in the 
documentation
+.\" *   and/or other materials provided with the distribution.
+.\" * - Neither the name of the MontaVista Software, Inc. nor the names of its
+.\" *   contributors may be used to endorse or promote products derived from 
this
+.\" *   software without specific prior written permission.
+.\" *
+.\" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 
IS"
+.\" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
PURPOSE
+.\" * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+.\" * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+.\" * THE POSSIBILITY OF SUCH DAMAGE.
+.\" */
+.TH VOTEQUORUM_QDEVICE_UPDATE 3 @BUILDDATE@ "corosync Man Page" "Corosync 
Cluster Engine Programmer's Manual"
+.SH NAME
+votequorum_qdevice_update \- Updates quorum device name
+.SH SYNOPSIS
+.B #include <corosync/votequorum.h>
+.sp
+.BI "int votequorum_qdevice_update(votequorum_handle_t " handle "const char " 
oldname ", const char " newname ");"
+.SH DESCRIPTION
+The
+.B votequorum_qdevice_update
+is used to change the name of the quorum device to corosync. The name of q 
quorum device is purely informational
+and has no significance to votequorum itself, but it's useful for the name 
(displayed by corosync-quorumtool)
+to reflect the actual device contributing votes to quorum to avoid user 
confusion.
+.SH RETURN VALUE
+This call returns the CS_OK value if successful, otherwise an error is 
returned.
+.PP
+.SH ERRORS
+@COMMONIPCERRORS@
+.SH "SEE ALSO"
+.BR votequorum_overview (8),
+.BR votequorum_initialize (3),
+.BR votequorum_finalize (3),
+.BR votequorum_getinfo (3),
+.BR votequorum_trackstart (3),
+.BR votequorum_trackstop (3),
+.BR votequorum_fd_get (3),
+.BR votequorum_dispatch (3),
+.BR votequorum_context_set (3),
+.BR votequorum_context_get (3),
+.BR votequorum_setexpected (3),
+.BR votequorum_setvotes (3),
+.BR votequorum_qdevice_register (3),
+.BR votequorum_qdevice_poll (3),
+.BR votequorum_qdevice_master_wins (3),
+.BR corosync-quorumtool (8)
+.PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/corosync-2.3.2/test/testvotequorum2.c 
new/corosync-2.3.3/test/testvotequorum2.c
--- old/corosync-2.3.2/test/testvotequorum2.c   2013-11-26 15:39:34.000000000 
+0100
+++ new/corosync-2.3.3/test/testvotequorum2.c   2014-01-14 11:24:31.000000000 
+0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009 Red Hat, Inc.
+ * Copyright (c) 2009-2014 Red Hat, Inc.
  *
  * All rights reserved.
  *
@@ -37,6 +37,7 @@
 #include <sys/types.h>
 #include <stdio.h>
 #include <stdint.h>
+#include <string.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <corosync/corotypes.h>
@@ -44,86 +45,132 @@
 
 static votequorum_handle_t handle;
 
-static void print_info(int ok_to_fail)
+static int print_info(int ok_to_fail)
 {
        struct votequorum_info info;
        int err;
 
-       if ( (err=votequorum_getinfo(handle, VOTEQUORUM_QDEVICE_NODEID, &info)) 
!= CS_OK)
+       if ( (err=votequorum_getinfo(handle, VOTEQUORUM_QDEVICE_NODEID, &info)) 
!= CS_OK) {
                fprintf(stderr, "votequorum_getinfo error %d: %s\n", err, 
ok_to_fail?"OK":"FAILED");
+               return -1;
+       }
        else {
                printf("name           %s\n", info.qdevice_name);
                printf("qdevice votes  %d\n", info.qdevice_votes);
                if (info.flags & VOTEQUORUM_INFO_QDEVICE_ALIVE) {
-                       printf("alive\n");
+                       printf("alive ");
                }
                if (info.flags & VOTEQUORUM_INFO_QDEVICE_CAST_VOTE) {
-                       printf("cast vote\n");
+                       printf("cast-vote ");
                }
                if (info.flags & VOTEQUORUM_INFO_QDEVICE_MASTER_WINS) {
-                       printf("master wins\n");
+                       printf("master-wins");
                }
-               printf("\n");
+               printf("\n\n");
        }
+       return 0;
+}
+
+static void usage(const char *command)
+{
+  printf("%s [-p <num>] [-t <time>] [-n <name>] [-c] [-m]\n", command);
+        printf("      -p <num>  Number of times to poll qdevice (default 
0=infinte)\n");
+        printf("      -t <secs> Time (in seconds) to wait between polls 
(default=1)\n");
+        printf("      -n <name> Name of quorum device (default QDEVICE)\n");
+        printf("      -c        Cast vote (default yes)\n");
+        printf("      -q        Don't print device status every poll time 
(default=will print)\n");
+        printf("      -m        Master wins (default no)\n");
+        printf("      -1        Print status once and exit\n");
 }
 
 int main(int argc, char *argv[])
 {
        int ret = 0;
-       int cast_vote = 1, master_wins = 1;
-       int pollcount=0, polltime=1;
+       int cast_vote = 1, master_wins = 0;
+       int pollcount=0, polltime=1, quiet=0, once=0;
        int err;
+       int opt;
+       const char *devicename = "QDEVICE";
+       const char *options = "n:p:t:cmq1h";
+       
+       while ((opt = getopt(argc, argv, options)) != -1) {
+               switch (opt) {
+               case 'm':
+                       master_wins = 1;
+                       break;
+               case 'c':
+                       cast_vote = 1;
+                       break;
+               case '1':
+                       once = 1;
+                       break;
+               case 'q':
+                       quiet = 1;
+                       break;
+               case 'p':
+                       pollcount = atoi(optarg)+1;
+                       break;
+               case 'n':
+                       devicename = strdup(optarg);
+                       break;
+               case 't':
+                       polltime = atoi(optarg);
+                       break;
+               case 'h':
+                       usage(argv[0]);
+                       exit(0);
+               }
+       }
 
        if ( (err=votequorum_initialize(&handle, NULL)) != CS_OK) {
                fprintf(stderr, "votequorum_initialize FAILED: %d\n", err);
                return -1;
        }
 
-       print_info(1);
-
-       if (argc >= 2 && atoi(argv[1])) {
-               pollcount = atoi(argv[1]);
-       }
-       if (argc >= 3 && atoi(argv[2])) {
-               polltime = atoi(argv[2]);
+       if (quiet && once) {
+               fprintf(stderr, "setting both -q (quet) and -1 (once) makes no 
sense\n");
+               usage(argv[0]);
+               exit(1);
        }
-       if (argc >= 4) {
-               cast_vote = atoi(argv[3]);
+
+       if (!quiet) {
+               print_info(1);
        }
-       if (argc >= 5) {
-               master_wins = atoi(argv[4]);
+       if (once) {
+               exit(0);
        }
 
        if (argc >= 2) {
-               if ( (err=votequorum_qdevice_register(handle, "QDEVICE")) != 
CS_OK) {
+               if ( (err=votequorum_qdevice_register(handle, devicename)) != 
CS_OK) {
                        fprintf(stderr, "qdevice_register FAILED: %d\n", err);
                        ret = -1;
                        goto out;
                }
 
-               if ( (err=votequorum_qdevice_master_wins(handle, "QDEVICE", 
master_wins)) != CS_OK) {
+               if ( (err=votequorum_qdevice_master_wins(handle, devicename, 
master_wins)) != CS_OK) {
                        fprintf(stderr, "qdevice_master_wins FAILED: %d\n", 
err);
                        ret = -1;
                        goto out;
                }
 
-               while (pollcount--) {
-                       print_info(0);
-                       if ((err=votequorum_qdevice_poll(handle, "QDEVICE", 
cast_vote)) != CS_OK) {
+               while (--pollcount) {
+                       if (!quiet) print_info(0);
+                       if ((err=votequorum_qdevice_poll(handle, devicename, 
cast_vote)) != CS_OK) {
                                fprintf(stderr, "qdevice poll FAILED: %d\n", 
err);
                                ret = -1;
                                goto out;
                        }
-                       print_info(0);
+                       if (!quiet) print_info(0);
                        sleep(polltime);
                }
-               if ((err= votequorum_qdevice_unregister(handle, "QDEVICE")) != 
CS_OK) {
+               if ((err= votequorum_qdevice_unregister(handle, devicename)) != 
CS_OK) {
                        fprintf(stderr, "qdevice unregister FAILED: %d\n", err);
                        ret = -1;
                        goto out;
                }
        }
-       print_info(1);
+
+        if (!quiet) print_info(1);
 
 out:
        votequorum_finalize(handle);

++++++ corosync-conf-example.patch ++++++
Index: corosync-2.3.2/conf/corosync.conf.example
===================================================================
--- corosync-2.3.2.orig/conf/corosync.conf.example
+++ corosync-2.3.2/conf/corosync.conf.example
@@ -9,6 +9,12 @@ totem {
        crypto_cipher: none
        crypto_hash: none
 
+       # Limit generated nodeids to 31-bits (positive signed integers)
+       # you would set it to 'yes', the new option 'new' means wiping 
+       # off the highest bit in network order to avoid possible nodeid
+       # conflicting.
+       clear_node_high_bit: yes
+
        # interface: define at least one interface to communicate
        # over. If you define more than one interface stanza, you must
        # also set rrp_mode.
@@ -77,5 +83,5 @@ logging {
 quorum {
        # Enable and configure quorum subsystem (default: off)
        # see also corosync.conf.5 and votequorum.5
-       #provider: corosync_votequorum
+       provider: corosync_votequorum
 }
Index: corosync-2.3.2/conf/corosync.conf.example.udpu
===================================================================
--- corosync-2.3.2.orig/conf/corosync.conf.example.udpu
+++ corosync-2.3.2/conf/corosync.conf.example.udpu
@@ -5,6 +5,8 @@ totem {
        crypto_cipher: none
        crypto_hash: none
 
+       clear_node_high_bit: yes
+
        interface {
                ringnumber: 0
                bindnetaddr: 10.16.35.0
@@ -54,5 +56,5 @@ nodelist {
 quorum {
        # Enable and configure quorum subsystem (default: off)
        # see also corosync.conf.5 and votequorum.5
-       #provider: corosync_votequorum
+       provider: corosync_votequorum
 }
++++++ corosync-cts-api-error.patch ++++++
Index: corosync-2.3.2/cts/corolab.py
===================================================================
--- corosync-2.3.2.orig/cts/corolab.py
+++ corosync-2.3.2/cts/corolab.py
@@ -308,10 +308,10 @@ if __name__ == '__main__':
     elif Environment["all-once"] or NumIter == 0: 
         NumIter = len(Tests)
         scenario = AllOnce(
-            cm, [ InitClusterManager(Environment), 
TestAgentComponent(Environment), PacketLoss(Environment) ], Audits, Tests)
+            cm, [ BootCluster(Environment), TestAgentComponent(Environment), 
PacketLoss(Environment) ], Audits, Tests)
     else:
         scenario = RandomTests(
-            cm, [ InitClusterManager(Environment), 
TestAgentComponent(Environment), PacketLoss(Environment) ], Audits, Tests)
+            cm, [ BootCluster(Environment), TestAgentComponent(Environment), 
PacketLoss(Environment) ], Audits, Tests)
 
     Environment.log(">>>>>>>>>>>>>>>> BEGINNING " + repr(NumIter) + " TESTS ")
     Environment.log("Stack:            %s" % Environment["Stack"])
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to