Commit Graph

36 Commits

Author SHA1 Message Date
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
87b6a141ff * exec/objdb.c (object_create): make "object_name" param const
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1930 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-30 21:11:25 +00:00
Jim Meyering
b107445d5a objdb.c, etc: add "const" to avoid warnings
* exec/objdb.c:
* include/corosync/engine/coroapi.h:
* include/corosync/engine/objdb.h:

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1928 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-30 21:11:09 +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
Steven Dake
2a4c53dc1b Fix several errors in objdb notification handling, hdb_handle_t type
conversion errors, indentation, and do hdb_handle_put after instance 
data is used instead of before.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1841 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-03-11 23:09:04 +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
Christine Caulfield
98cc132d48 Fix a couple of memory leaks
The objdb occurred because object_find_destroy wasn't implemented!
 
The one in confdb occurred because object_find_destroy wasn't called if
object_find_next returned an error the first time it was invoked (ie
there were no subobjects).



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1741 fd59a12c-fef9-0310-b244-a6a79926bd2f
2009-01-23 15:41:06 +00:00
Angus Salkeld
aec3b38cde Fix coverity bug ID 1: overused local variable
coverity says that in exec/objdb.c: 1075 the found is always == 1
therefore the code is dead.  But this is just a case of an overused
local variable. "found" is used for two different searches.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1716 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-12-28 09:05:05 +00:00
Angus Salkeld
3bc868eb54 Fix a memory violation in objdb (caught by valgrind)
If the new length is larger then memory will be overwritten.

I could make this ">=" but we can save memory if the new size is smaller by using "!=".



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1680 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-10-30 19:32:23 +00:00
Christine Caulfield
44eaef35e0 Currently if a reload operation fails, any subsystems listening for
notifications will get a RELOAD_NOTIFY_START callback but not a
RELOAD_NOTIFY_END callback.

This patch adds a RELOAD_NOTIFY_FAILED callback so that interested
parties will know when the reload has finished and that it failed.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1678 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-10-27 08:25:53 +00:00
Christine Caulfield
f1764d1f56 Add locking around objdb calls so that reloads and writes are atomic.
Also add a notification callback for reload. Both the start and the stop
are notified so that the user can decide what to do with the flurry of 
updates that occur.

Note than the reload callback notification MUST be registered against
OBJECT_PARENT_HANDLE. Registering it lower down the hierarchy makes no sense.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1673 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-10-06 12:14:40 +00:00
Christine Caulfield
a7885395d2 Reinstate key_iter_reset that got removed by mistake in 1660
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1663 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-09-03 10:01:31 +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
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
Fabio M. Di Nitto
e4cfe7eb21 Revert config_verifyconf logic that is unnecessary
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1631 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-14 12:05:39 +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
Fabio M. Di Nitto
38f8abd072 objdb: change list_add to list_add_tail when adding keys and objects
service: change openais_service_unlink_all to deal with the new objdb order

cleanup a few whitespaces



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1627 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-12 08:41:09 +00:00
Steven Dake
225b183bcb Add callback notification about changes to the object db and confdb apis.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1625 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-08-05 16:34:14 +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
Steven Dake
46b0163813 Change all email addresses that were sdake@mvista.com to sdake@redhat.com.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1541 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-05-12 13:48:06 +00:00
Patrick Caulfield
87e7ea9c1e Add writeback call to objdb
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1530 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-04-30 15:32:04 +00:00
Steven Dake
37c7b6184b Fix build error.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1529 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-04-29 10:08:11 +00:00
Steven Dake
4ad44b9c86 load and unload service engines at runtime.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1528 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-04-28 16:25:47 +00:00
Patrick Caulfield
9ab240e478 Add confdb, a library to access the configuration object database.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1516 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-04-16 12:07:05 +00:00
Patrick Caulfield
2846b57ea1 Add some new calls into objdb.
These allow replacing/removing keys, and deleting a whole object subtree,
iterator functions to enumerate all objects/keys on an object,
and a dump call for debugging.



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1505 fd59a12c-fef9-0310-b244-a6a79926bd2f
2008-03-10 15:18:12 +00:00
Steven Dake
3c7f8b7c05 This patch reworks IPC to use threads instead of the main poll loop
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1011 fd59a12c-fef9-0310-b244-a6a79926bd2f
2006-04-27 01:39:10 +00:00
Steven Dake
6199aaa3bd Fix object_priv_get to actually call object_priv_get instead of object_priv_set
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@986 fd59a12c-fef9-0310-b244-a6a79926bd2f
2006-04-15 07:38:25 +00:00
Steven Dake
758719ea87 fix fc5 segfault correctly by removing code that violates strict aliasing
rules.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@983 fd59a12c-fef9-0310-b244-a6a79926bd2f
2006-04-13 23:20:03 +00:00
Steven Dake
6a49f1befc defect 1139
reorg of code to better support creating external service handlers


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@972 fd59a12c-fef9-0310-b244-a6a79926bd2f
2006-04-08 22:05:51 +00:00
Patrick Caulfield
0fcbd1e12c Set the object value length too.
git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@965 fd59a12c-fef9-0310-b244-a6a79926bd2f
2006-04-03 08:47:42 +00:00
Steven Dake
4a33ba11fa defect 1139
merge object database and do a general refactor of the code


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@952 fd59a12c-fef9-0310-b244-a6a79926bd2f
2006-03-18 21:00:19 +00:00