Commit Graph

78 Commits

Author SHA1 Message Date
Angus Salkeld
c94dba0b49 cov 10385: assigning signed int to unsigned variable
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2828 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-14 02:07:39 +00:00
Angus Salkeld
8ebe03efd5 diags: add a mechanism to trigger the writing the flight data
trigger the dumping of flight data using:
 corosync-objctl -w runtime.blackbox.dump_flight_data=anything
trigger the dumping of state using:
 corosync-objctl -w runtime.blackbox.dump_state=anything

then read the flight data as usual:
 corosync-fplay

This patch includes a wrapper script called:
 corosync-blackbox



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2799 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-05-04 00:56:25 +00:00
Angus Salkeld
1e17751d0d Remove warnings.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2682 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-03-11 00:27:04 +00:00
Angus Salkeld
a1a5e21975 COVERITY 17: fix exit handling in show_votes().
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2548 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-22 23:59:51 +00:00
Angus Salkeld
28f7c1e51f COVERITY 13: prevent buffer overrun in quorum-tool.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2546 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-11-22 06:34:11 +00:00
Angus Salkeld
97ed934966 Fix the OSX build (broken by stats patches)
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2521 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-13 08:13:53 +00:00
Angus Salkeld
e2a39ede1d Remove silly warning in corosync-objdb
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2516 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-12 17:29:19 +00:00
Angus Salkeld
73b7aa19bb Add value types to objdb keys.
This allows you to create a key with a know type.
And then get the type with the key value.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2511 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-10-10 03:20:38 +00:00
Christine Caulfield
7f3da97ca3 Really add corosync-quorumtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2407 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-08 08:19:11 +00:00
Christine Caulfield
6f3fabe398 Add corosync-quorumtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2406 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-08 08:14:58 +00:00
Fabio M. Di Nitto
8dad75ef05 Fix corosync-tools linking
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2402 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-09-07 07:24:15 +00:00
Jan Friesse
e25f36b653 Real add of corosync-cpgtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2401 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-31 15:58:12 +00:00
Jan Friesse
bc5031ff2f Initial version of corosync-cpgtool
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2400 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-31 09:57:20 +00:00
Steven Dake
69ced80179 Request user enter characters into terminal if entropy pool is empty for keygen
rather then exiting without creating an auth key.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2387 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-08-17 17:18:26 +00:00
Angus Salkeld
42d3c01cb1 add "-p" option to corosync-objctl
This just adds a "-p" option to corosync-objctl.

So you can do the following (like sysctl).

corosync-objctl -p /path/to/object.conf



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2308 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-27 04:37:51 +00:00
Fabio M. Di Nitto
2135d91c27 Fix handling of sysconfdir
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2265 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-19 07:02:55 +00:00
Fabio M. Di Nitto
9a94d633cf flight recorder: switch from int to bytes for requested allocation
The flight recoder buffer size as specified in LOGSYS_DECLARE_SYSTEM
or _logsys_rec_init was expressed in number of ints. A developer asking
to allocate 512K would get a 2M allocation on a machine with sizeof(int) = 4.

This is confusing and the patch addresses it:

- rename rec_size to fltsize for external API (no type change),
  because rec_size is used many times internally for other reasons
  and it can be confusing.

- rename size to fltsize in _logsys_rec_init.

- document what we allocate and why.

- swap comments around to match the code.

- introduce a simple macro to perform rounding (stolen from linux-2.6.git).

- start shaping fdata header to better handle dynamic values:
  * write the flt_data_size as first unsigned int the header.
  * change corosync-fplay to read the value and alloc the right amount
    of memory instead of hardcoding it again.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2255 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 17:40:41 +00:00
Fabio M. Di Nitto
6d5ce092a1 logsys: port to new packed rec_ident version
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2250 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 05:32:56 +00:00
Fabio M. Di Nitto
5597a2381f logsys: merge tags into rec_ident
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2246 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-18 05:15:10 +00:00
Jan Friesse
c54e74e3f6 Make /etc/corosync/corosync.conf default configuration file
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2235 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-12 10:22:32 +00:00
Christine Caulfield
94e4234c99 Fix corosync-cfgtool -a so that it actaully produces some output!
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2227 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-10 07:33:19 +00:00
Christine Caulfield
3855b4285e Don't let corosync-keygen fail if /etc/ais already exists
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2207 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-04 16:12:08 +00:00
Jan Friesse
8605bbc7b2 Fix coroipcc linking
Fixes rhbz#499918
	
Functions from ckpt library (like aCkptCheckpointOpen,
saCkptSectionIterationInitialize, ...) internally uses corosync functions
reply_receive, reply_receive_in_buf, ... This functions are included in
coroipcc.c source file and uses global static variable ipc_hdb.

Without patch, coroipcc is linked to shared library (libcoroipcc.so) AND linked
with every corosync libraries (like cpg, ....), so global variable ipc_hdb is
included not only in libcoroipcc.so, but also in libcpg.so, ...

dlm_controld has function retrieve_plocks, and whole binary is linked with
libcoroipcc and libcpg. So ipc_hdb is included TWICE (so has TWO addresses).

Main problem causing the bug was, that reply_receive uses address from one
library, and reply_receive_in_buf uses other. This confuses check of hdb_get
function.

After removing linking of coroipcc.o to cpg, and rather use of dynamic version,
 (this means, there is only one instance of ipc_hdb) problem disappeared.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2203 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-06-01 08:46:10 +00:00
Jim Meyering
1f40a10983 don't include <signal.h> when it's not used
* exec/coroparse.c: Likewise.
* exec/quorum.c: Likewise.
* exec/sync.c: Likewise.
* exec/totemmrp.c: Likewise.
* exec/totemnet.c: Likewise.
* exec/totemrrp.c: Likewise.
* exec/totemsrp.c: Likewise.
* exec/vsf_quorum.c: Likewise.
* exec/vsf_ykd.c: Likewise.
* lcr/uic.c: Likewise.
* lcr/uis.c: Likewise.
* lib/cfg.c: Likewise.
* services/cfg.c: Likewise.
* services/cpg.c: Likewise.
* services/evs.c: Likewise.
* services/pload.c: Likewise.
* services/testquorum.c: Likewise.
* services/votequorum.c: Likewise.
* test/testconfdb.c: Likewise.
* test/testcpg.c: Likewise.
* test/testcpgzc.c: Likewise.
* test/testzcgc.c: Likewise.
* tools/corosync-cfgtool.c: Likewise.
* tools/corosync-objctl.c: Likewise.
* tools/corosync-pload.c: Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2193 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-18 16:41:46 +00:00
Jim Meyering
d44aad2eea don't include <assert.h> when it's not used
* exec/apidef.c: Likewise.
* exec/mainconfig.c: Likewise.
* exec/service.c: Likewise.
* exec/timer.c: Likewise.
* exec/totemconfig.c: Likewise.
* exec/totemmrp.c: Likewise.
* exec/vsf_quorum.c: Likewise.
* services/testquorum.c: Likewise.
* test/cpgbench.c: Likewise.
* test/cpgbenchzc.c: Likewise.
* tools/corosync-fplay.c: Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2192 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-18 16:41:37 +00:00
Fabio M. Di Nitto
75c9085204 Fix logsys TAG handling
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2180 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-05-13 03:59:47 +00:00
Christine Caulfield
e9660ee62f Add libnss security support to corosync.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2145 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-25 14:05:27 +00:00
Steven Dake
65f8490350 use uint64_t for hdb_handle_t type and also specify some formatting
strings for printing handles out of the handle database.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2126 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-23 10:03:01 +00:00
Jim Meyering
d86737ac9c remove empty lines at end-of-file
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2118 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-22 08:04:06 +00:00
Jim Meyering
904a10ed38 remove all trailing blanks
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2117 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-22 08:03:55 +00:00
Steven Dake
75c4bc0d71 Zero copy feature for IPC transmits. Also integrated into CPG library
service.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2114 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-21 23:37:49 +00:00
Jim Meyering
f5edd27d1d corosync-cfgtool.c: handle strdup failure gracefully
* tools/corosync-cfgtool.c (xstrdup): New function.
(main): Use it in place of strdup.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2100 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-20 18:26:22 +00:00
Steven Dake
221dddd0dd add schedwrk_create and schedwrk_destroy coroapi functions.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2089 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-18 14:39:57 +00:00
Jim Meyering
3081a12f18 corosync-fplay.c: don't shadow file-scoped global, "record"
* tools/corosync-fplay.c: Rename: s/record/g_record/.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2074 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-15 19:13:03 +00:00
Jim Meyering
567ea5464c corosync-fplay.c: avoid shadowin: s/index/idx/
* tools/corosync-fplay.c (printer_totempg_mcast_fits):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2072 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-15 19:12:48 +00:00
Jim Meyering
f2ceecc700 corosync-keygen.c: diagnose a few more failures
* tools/corosync-keygen.c (main): Diagnose short reads, failed mkdir
and fchmod; detect write failure.  Close file descriptors.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2059 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-15 06:47:34 +00:00
Steven Dake
ee82f48345 Remove warning in keygen and report error on fchown appropriately.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2052 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-10 02:44:51 +00:00
Steven Dake
2827180b36 Remove warning in corosync-objctl.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2051 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-10 02:40:33 +00:00
Jim Meyering
00db317b82 sync the rest of the code with previous header changes
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2042 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-08 17:29:37 +00:00
Jim Meyering
781d3454c2 confdb.h: continue API changes: const+size_t
* include/corosync/confdb.h (confdb_object_create_notify_fn_t):
(confdb_object_delete_notify_fn_t):
* tools/corosync-objctl.c (tail_object_created, tail_object_deleted):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2001 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-03 20:30:54 +00:00
Jim Meyering
41cc0e06b4 print "?" in place of non-printing bytes of obj/key/val values
* tools/corosync-objctl.c: Include <ctype.h>
(print_name): New function.
(tail_key_changed): Use it to avoid printing garbage to screen.
* include/corosync/confdb.h (confdb_key_change_notify_fn_t): Convert
type of "int" length params to "size_t".

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2000 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-03 20:30:41 +00:00
Jim Meyering
1701b32f1d confdb.h (confdb_key_change_notify_fn_t): Make 3 params "const"
* include/corosync/confdb.h (confdb_key_change_notify_fn_t):
Make 3 params const.
* tools/corosync-objctl.c (find_object_of_type_t, callbacks):
(tail_key_changed): Don't write into would-be-const members.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1999 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-03 20:30:33 +00:00
Jim Meyering
a8bad8dee2 corosync-objctl.c: remove a just-added "const"
* tools/corosync-objctl.c (get_key): Remove just-added const from
2nd parameter.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1989 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 17:55:41 +00:00
Jim Meyering
05f2a7afee remove unused file-scoped global
* tools/corosync-fplay.c (records_printed): Remove.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1985 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:34:01 +00:00
Jim Meyering
d2430bce4d avoid prototype warnings, constify
* tools/corosync-fplay.c: Make many parameters and local pointers const.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1984 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:33:49 +00:00
Jim Meyering
748cf03858 remove unused functions and variable
* tools/corosync-fplay.c (sync_printer_nada): Remove function.
* tools/corosync-objctl.c (get_child_name): Remove function.
* test/evsverify.c (msg): Remove unused variable.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1983 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:33:36 +00:00
Jim Meyering
9bd1a8e728 declare many functions "static" (also avoids missing prototype warnings)
* exec/main.c (sigintr_handler, serialize_lock, serialize_unlock):
(serialize_lock, serialize_unlock):
* exec/sync.c (sync_start_init, sync_callbacks_load):
* exec/vsf_ykd.c (ykd_state_init):
* lcr/uis.c (cmd1):
* services/pload.c (send_message, token_callback, start_mcasting):
* tools/corosync-cfgtool.c (service_load_do, service_unload_do):
(shutdown_do, showaddrs_do, killnode_do, usage_do):
* tools/corosync-fplay.c (totemip_print, print_string_len):
(sync_printer_confchg_set_sync, sync_printer_set_sync_state):
(sync_printer_process_currentstate):
(sync_printer_process_get_shouldsync):
(sync_printer_checkpoint_release):
(sync_printer_checkpoint_transmit, sync_printer_section_transmit):
(sync_printer_checkpoint_receive, sync_printer_section_receive):
(sync_printer_nada, sync_printer_confchg_fn):
(printer_totemsrp_mcast, printer_totemsrp_delv):
(printer_totempg_mcast_fits, sync_printer_service_process):
* tools/corosync-objctl.c (get_child_name, get_parent_name):
(get_key):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1980 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:33:07 +00:00
Jim Meyering
51cad562ae add "void" parameter list to avoid "isn't prototype" warning
* exec/objdb.c (objdb_wrlock, objdb_rdlock, objdb_rdunlock):
(objdb_wrunlock):
* services/cfg.c (send_shutdown, check_shutdown_status):
* services/votequorum.c (send_expectedvotes_notification):
* tools/corosync-cfgtool.c (shutdown_do):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1977 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-01 09:32:32 +00:00
Jim Meyering
b7e9fcaa1b corosync-fplay.c: make more robust, avoid warnings
* tools/corosync-fplay.c (main): Diagnose malloc,open, and read failures

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1926 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-30 21:10:53 +00:00
Fabio M. Di Nitto
031c02f589 - Every .c file should include "config.h" to get the right defines...
- services/Makefile.am: add include search paths for config.h

- include/corosync/cs_config.h.in exports LCRSODIR and SOCKETDIR

- tools/Makefile.am: drop -D defines for dirs that are now in
cs_config.h or config.h

- configure.ac: sanitize prefix and exec_prefix paths. Export DIRS in
*config.h

- lib/Makefile.am: : drop -D defines for dirs that are now in
cs_config.h or config.h. Add rule to build lcr_ifact.o or building from
lib/ fails miserably



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1877 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-19 12:58:53 +00:00