Renier Morales a écrit :
> The problem may be that the session is not subscribed to receive
> events, when the resource failed event is reported. By the time you
> run hpievents, the event already came and went.
>
> If you put your code in get_event like I've already suggested, it
> should work.
> You can also try running hpievents blocking for events (hpievents -h
> for more info) while running hpitree to get your code to generate the
> event.
>
> You can also look at the domain event log (with hpiel) to see if the
> event got logged there. Events get logged in the domain event log if
> they are of high enough severity (MINOR by default). This severity
> threshold can be changed in openhpi.conf.
>
> Saludos,
In fact, after a glance into the get_event() function, it appears that
the function do nothing except return that no events are to be processed :
/*
* Return values:
* 1 - events to be processed.
* SA_OK - No events to be processed.
* SA_ERR_HPI_INVALID_PARAMS - @hnd is NULL.
*/
SaErrorT sim_get_event(void *hnd)
{
/*struct oh_handler_state *state = hnd;
struct oh_event *e = NULL;*/
if (!hnd) return SA_ERR_HPI_INVALID_PARAMS;
/*
e = g_async_queue_try_pop(state->eventq_async);
if (e) {
trace("retrieving sim event from async q");
*event = *e;
g_free(e);
return 1;
} else {
trace("no more events for sim instance");
return 0;
}*/
return SA_OK;
}
I tried to modify this function like below but now it's hanging on the
g_async_queue_try_pop call :
SaErrorT sim_get_event(void *hnd, struct oh_event *event, struct timeval
*timeout )
{
struct oh_handler_state *state = hnd;
struct oh_event *e = NULL;
if (!hnd) return SA_ERR_HPI_INVALID_PARAMS;
e = g_async_queue_try_pop(state->eventq);
if (e) {
trace("retrieving sim event from async q");
*event = *e;
g_free(e);
return 1;
} else {
trace("no more events for sim instance");
return 0;
}
return SA_OK;
}
But, even if i understand better why it was not working, i do not
understand now why it's hanging. Any thought ?
Thanks,
Lionel Tricon
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Openhpi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openhpi-devel