David Bustos wrote:
> Quoth Alan Maguire on Thu, Jan 24, 2008 at 07:04:12PM +0000:
>   
>> under the SMF datalink/interface networking model we've
>> been discussing here and elsewhere, SMF instances will
>> exist for datalinks and IP interfaces. one problem with this
>> is that the policy engine handling such instances, e.g. NWAM,
>> would like to receive notifications of adminstrator-driven events
>> such as disabling the instance or refreshing, while not taking
>> full responsibility for managing the instance (as a delegated restarter
>> would - NWAM can't be a delegated restarter since the datalink/IP
>> interface instances exist whether NWAM is enabled or not).
>>     
>
> Has this been discussed elsewhere?  I would like to understand what you
> require that we don't provide.
>
>   
not really. but essentially what we're trying to do
is cope with the fact that nwamd is not
not a delegated restarter for SMF datalink and IP
interface instances - because it is only one possible
network "policy engine" that  carries out networking
configuration. what we need is a way for policy
engines (such as nwamd) to detect instance refresh
events (so that  internal state can be updated to
reflect the latest configuration changes), enable
and disable events (so that, as well as the basic
setup/teardown of the abstraction represented
by the instance carried out by the start
and stop methods, we can do any policy-engine
specific work that might be required, such as
switch profile).

if nwamd were a delegated restarter, we could
catch such events easily of course, but it can't
be for the reason mentioned above (if it were,
switching policy engine would mean switching
delegated restarter, i think that'd be difficult to
manage). it would be good if we could register
for restarter events in a listening capacity, but i
think that might take a bit of work, since it seems
like startd events are handled via an internal queue
rather than using event channels.
>> one approach would be to use (and of course a contract
>> would be needed for this) the private libscf property group
>> notification function _scf_notify_add_pgname(), specifying
>> we want notifications for the SCF_PG_GENERAL, SCF_PG_GENERAL_OVR and
>> SCF_PG_RESTARTER_ACTIONS property groups.  placing notifications on
>> the first two catches enable and disable events, persistent and
>> temporary. notifications for SCF_PG_RESTARTER_ACTIONS catch
>> refresh, restart, maintenance, clear events. we can then use
>> _scf_notify_wait(), fish out the FMRI and handle the event.
>> does this approach have drawbacks? is there a better way to
>> catch such events? thanks!
>>     
>
> This would probably work, but I'm doubtful that it's the right
> architectural direction.  Let's determine what's missing in the
> delegation model and how expensive it would be to fill it in before we
> go too far with this.
>   
sounds good. what about enhancing librestart's
restart_bind_handle() function with a flag specifying
"listen only", so that the caller doesn't have to be the
delegated restarter to register an eventhandler?
thanks!

alan

Reply via email to