Add dump_state to coroapi.h. Need to remove logging output from signal

handlers.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2281 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2009-06-22 18:18:15 +00:00
parent 19e1f60dd3
commit 71d2a32512
4 changed files with 16 additions and 2 deletions

View File

@ -140,7 +140,8 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = {
.plugin_interface_release = lcr_ifact_release,
.error_memory_failure = _corosync_out_of_memory_error,
.fatal_error = _corosync_public_exit_error,
.request_shutdown = corosync_request_shutdown
.request_shutdown = corosync_request_shutdown,
.state_dump = corosync_state_dump
};
void apidef_init (struct objdb_iface_ver0 *objdb) {

View File

@ -124,7 +124,7 @@ hdb_handle_t corosync_poll_handle;
struct sched_param global_sched_param;
static void sigusr2_handler (int num)
void corosync_state_dump (void)
{
int i;
@ -135,6 +135,15 @@ static void sigusr2_handler (int num)
}
}
static void sigusr2_handler (int num)
{
/*
* TODO remove this from sigusr2 handler and access via cfg service
* engine api - corosync-cfgtool
*/
corosync_state_dump ();
}
/*
* TODO this function needs some love
*/

View File

@ -66,4 +66,6 @@ extern int message_source_is_local (const mar_message_source_t *source);
extern void corosync_request_shutdown (void);
extern void corosync_state_dump (void);
#endif /* MAIN_H_DEFINED */

View File

@ -576,6 +576,8 @@ struct corosync_api_v1 {
void (*fatal_error) (cs_fatal_error_t err, const char *file, unsigned int line);
void (*request_shutdown) (void);
void (*state_dump) (void);
};
#define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )