Commit Graph

34 Commits

Author SHA1 Message Date
Angus Salkeld
89e4c1c048 CONFDB: add confdb_object_name_get()
This is useful when tracking object changes.

Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
Reviewed-by: Seven Dake <sdake@redhat.com>
2011-02-04 09:47:15 -07:00
Angus Salkeld
5dd31150ee convert strtok to strtok_r
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2663 fd59a12c-fef9-0310-b244-a6a79926bd2f
2010-02-25 19:25:20 +00:00
Angus Salkeld
663f894498 make sure key_names past from confdb are null terminated.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2561 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-12-02 22:14:00 +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
Steven Dake
bf624c727d Implement thread saftey in corosync trunk.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2165 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-29 07:21:21 +00:00
Jim Meyering
89c6d6a1a1 rewrite strstr_rs not to use strdup
strstr_rs used strdup and didn't handle failure.  This change removes
the use of strdup as well as the uses of strstr, since all callers
passed a string of length 1 as the second argument.  This also changes
the prototype so that the 2nd parameter is a byte, not a string.

* util.h (strstr_rs): Adjust prototype.
* util.c (strstr_rs): Rewrite/simplify.
* sa-confdb.c (strstr_rs): Remove duplicate definition.
* coroparse.c (parse_section): Update callers.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2111 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-21 11:56:47 +00:00
Jim Meyering
de3175bc69 remove useless if-before-free tests
* exec/coropoll.c (poll_destroy): Remove useless if.
* exec/main.c (main): Likewise.
* include/corosync/hdb.h (hdb_destroy): Likewise.
* lcr/lcr_ifact.c (scandir): Likewise.
* lib/sa-confdb.c (load_config): Likewise.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2106 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-21 07:28:18 +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
62e71c31d6 coroapi.h, confdb.h, objdb.h: big s/int/size_t/ change
* exec/mainconfig.c (objdb_get_string, objdb_get_int):
* exec/totemconfig.c (objdb_get_string, objdb_get_int)
(totem_config_keyread, totem_key_change_notify):
* include/corosync/confdb.h (confdb_callbacks_t):
* include/corosync/engine/coroapi.h (group_len, object_len)
(key_len, validate_callback, object_key_change_notify_fn_t)
(object_create_notify_fn_t, object_destroy_notify_fn_t)
(object_notify_callback_fn_t, object_reload_notify_fn_t)
(object_create, object_key_create, object_find_create)
(object_key_get, object_key_replace, object_key_delete)
(object_iter, object_key_iter, object_name_get)
(object_key_iter_from, object_key_increment)
(object_key_decrement):
* include/corosync/engine/objdb.h (object_key_change_notify_fn_t)
(object_create_notify_fn_t, object_destroy_notify_fn_t)
(object_len, key_len, validate_callback, object_create)
(object_key_create, object_find_create, object_key_get)
(object_key_replace, object_key_delete, object_iter)
(object_key_iter, object_name_get, object_key_iter_from)
(object_key_increment, object_key_decrement):
* lib/confdb.c (confdb_object_create, confdb_key_create)
(confdb_key_delete, confdb_key_get, confdb_key_increment)
(confdb_key_decrement, confdb_key_replace, confdb_object_find)
(confdb_object_iter, confdb_key_iter):
* lib/sa-confdb.c (confdb_sa_object_create, confdb_sa_key_create)
(confdb_sa_key_delete, confdb_sa_key_get)
(confdb_sa_key_increment, confdb_sa_key_decrement)
(confdb_sa_key_replace, confdb_sa_object_find)
(confdb_sa_object_iter, confdb_sa_key_iter):
* lib/sa-confdb.h:
* services/confdb.c (message_handler_req_lib_confdb_key_replace):
* services/votequorum.c (objdb_get_string, objdb_get_int)
(quorum_key_change_notify, votequorum_objdb_reload_notify):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2040 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-08 17:29:16 +00:00
Jim Meyering
6b9505992f confdb.h (confdb_reload) Add errbuf_len parameter and propagate.
* include/corosync/confdb.h (confdb_callbacks_t):
* lib/confdb.c (confdb_reload):
* lib/sa-confdb.c (confdb_sa_reload):
* lib/sa-confdb.h:
* test/testconfdb.c (main):

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2004 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-03 20:31:38 +00:00
Jim Meyering
b6378dc05d confdb_sa_write: propagate errbuf_len parameter
* lib/sa-confdb.c (confdb_sa_write): Propagate errbuf_len parameter.
* lib/sa-confdb.h: Update prototype

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2003 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-04-03 20:31:24 +00:00
Jim Meyering
eab6389be3 object_write_config: add const to remove one more
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1946 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-30 21:14:16 +00:00
Jim Meyering
39001fd1f6 objdb.c (object_reload_config): add const
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1931 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-30 21:11:38 +00:00
Steven Dake
c5fc824d7f Abstracted Shared Memory IPC library
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1885 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-22 15:28:54 +00:00
Jim Meyering
bfebf7da19 don't segfault upon failed strdup
* sa-confdb.c (load_config): Handle out-of-memory.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1881 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-20 15:48:19 +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
Christine Caulfield
2924b84b60 Fix some const warnings
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1828 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-10 17:13:37 +00:00
Christine Caulfield
d604803280 The current object database allows duplicate key names per object. This
is a bit of a nightmare to manage and provides no useful functionality
that I can see. Making keys unique has been discussed on IRC several
times and there seem to be no objections...so here is the patch:

Note that I have removed some now-useless parameters from the objdb API
too.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1783 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-02-26 14:49:41 +00:00
Steven Dake
58ab8d4a65 Unification around hdb_handle_t data type.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1782 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-02-25 11:14:47 +00:00
Steven Dake
c077255702 Whitetank IPC Forward Port.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1766 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-02-19 02:23:58 +00:00
Angus Salkeld
9e15bb3197 LINT: fix confd_sa API error.
remove extra parent_object_handle parameter.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1697 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-11-12 17:39:37 +00:00
Angus Salkeld
56eaee9561 cleanup the last of the SAF headers and types
This includes the rename of identifiers from corosync to cs.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1689 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-11-06 21:49:07 +00:00
Christine Caulfield
1d2d771f99 This patch adds key_increment and key_decrement calls to the objdb and
confdb subsystems.

This is useful to provide atomic counters (ag handle numbers) for
long-running (though not persistent) connections. It's not currently
possible via confdb to atomically get a new number from objdb due to the
lack of locking. Doing it via increment operations in the IPC thread
provides enough atomicity to make it useful. Fabio has already
identified a use for these calls.

It could also provide some form of basic co-operative locking mechanism
for IPC-using processes (not direct objdb calls).



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1662 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-09-03 07:58:08 +00:00
Christine Caulfield
2bab5b36cc Remove the disliked *_from calls from the objdb and recast
the confdb library to use the new find_create/find_next/find_destroy API
calls instead.

I've kept the libcondfb API the same as before with the single change of
adding a confdb_object_find_destroy to tidy up the find handle after
use. If you don't call this then libcondfb will do it for you when
confdb_finalize is called.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1660 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-26 07:34:22 +00:00
Steven Dake
dd3991c0bb Proper rename of openais usage to corosync throughout tree.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1637 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-14 16:54:46 +00:00
Steven Dake
e1f531380a Revert patch 1633 which breaks build.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1636 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-14 16:44:26 +00:00
Steven Dake
c4a1c7eb96 Change all occurances of openais to corosync.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1633 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-14 16:04:01 +00:00
Fabien Thomas
0c92a5e564 reorganize include file to match installed tree to build openais without installing corosync; correct some warnings and error under FreeBSD and Darwin
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1632 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-14 14:59:50 +00:00
Christine Caulfield
6c3ed50de0 Change AIS names to corosync
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1630 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-13 10:33:11 +00:00
Fabio M. Di Nitto
010198fac4 Add support for reload operations within objdb and plugins.
Use a 2 phase "commit" operation:
1) Invoke verifyconfig that should catch the errors before the reload operation
2) Invoke reloadconfig that performs the operation and should _never_ fail

Implementation note: if step 2 fails, there is no fall back at the moment.

Fix the IPC table for confdb:
MESSAGE_REQ_CONFDB_XPATH_EVAL_EXPRESSION = 12 was added to include/ipc_confdb.h
without an associated call. Thanks Chrissie for spotting this.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1629 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-13 03:58:03 +00:00
Steven Dake
617dbdf2f0 Split openais and corosync tree into two seperate repositories.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1622 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-05 13:23:46 +00:00
Steven Dake
46babc95ad Initial move of corosync and openais trees into seperate directories.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1582 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-07-21 07:59:08 +00:00
Patrick Caulfield
fef53eb2c4 Expose confdb write to the library.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1536 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-05-07 07:27:37 +00:00
Patrick Caulfield
1165060e46 Allow libconfdb to run standalone (without aisexec)
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1531 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-04-30 15:32:25 +00:00