From: Renier M. <re...@us...> - 2007-06-11 14:55:28
|
Lionel Tricon <lio...@di...> wrote on 06/11/2007 03:55:33 AM: > Renier Morales a =E9crit : > > 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=5Fevent 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, >=20 > In fact, after a glance into the get=5Fevent() function, it appears that > the function do nothing except return that no events are to be processed = : The function's purpose is to give the plugin a chance to generate events.=20 In the simulator's case, it doesn't generate any events except for the=20 ones created during discovery. The reason I told you to put your code (e.g. switch case generating failed = resource event) in get=5Fevent was to make it easier for you to see it as=20 you would only have had to run hpievents to do that. >=20 > /* > * Return values: > * 1 - events to be processed. > * SA=5FOK - No events to be processed. > * SA=5FERR=5FHPI=5FINVALID=5FPARAMS - @hnd is NULL. > */ > SaErrorT sim=5Fget=5Fevent(void *hnd) > { > /*struct oh=5Fhandler=5Fstate *state =3D hnd; > struct oh=5Fevent *e =3D NULL;*/ > if (!hnd) return SA=5FERR=5FHPI=5FINVALID=5FPARAMS; >=20 > /* > e =3D g=5Fasync=5Fqueue=5Ftry=5Fpop(state->eventq=5Fasync); > if (e) { > trace("retrieving sim event from async q"); > *event =3D *e; > g=5Ffree(e); >=20 > return 1; > } else { > trace("no more events for sim instance"); > return 0; > }*/ > return SA=5FOK; > } >=20 >=20 > I tried to modify this function like below but now it's hanging on the > g=5Fasync=5Fqueue=5Ftry=5Fpop call : >=20 > SaErrorT sim=5Fget=5Fevent(void *hnd, struct oh=5Fevent *event, struct ti= meval > *timeout ) > { > struct oh=5Fhandler=5Fstate *state =3D hnd; > struct oh=5Fevent *e =3D NULL; >=20 > if (!hnd) return SA=5FERR=5FHPI=5FINVALID=5FPARAMS; >=20 > e =3D g=5Fasync=5Fqueue=5Ftry=5Fpop(state->eventq); >=20 > if (e) { > trace("retrieving sim event from async q"); > *event =3D *e; > g=5Ffree(e); >=20 > return 1; > } else { > trace("no more events for sim instance"); > return 0; > } > return SA=5FOK; > } >=20 >=20 > But, even if i understand better why it was not working, i do not > understand now why it's hanging. Any thought ? The code you modified had been commented out because eventq is not=20 supposed to be used that way anymore. Did you try running both hpievents and hpitree in the way I said before?=20 or tried running hpiel? >=20 > Thanks, > Lionel Tricon |