PERFORCE change 124447 for review
Julian Elischer
julian at elischer.org
Wed Aug 1 01:27:57 UTC 2007
Marko Zec wrote:
there is a "really die" flag that should be used if a node may be associated with hardware,
or for some other reason be persistent.
/* Ask the type if it has anything to do in this case */
if (node->nd_type && node->nd_type->shutdown) {
(*node->nd_type->shutdown)(node);
if (NG_NODE_IS_VALID(node)) {
/*
* Well, blow me down if the node code hasn't declared
* that it doesn't want to die.
* Presumably it is a persistent node.
* If we REALLY want it to go away,
* e.g. hardware going away,
* Our caller should set NGF_REALLY_DIE in nd_flags.
*/
node->nd_flags &= ~(NGF_INVALID|NGF_CLOSING);
NG_NODE_UNREF(node); /* Assume they still have theirs */
return;
}
} else { /* do the default thing */
NG_NODE_UNREF(node);
}
>
> +#ifdef VIMAGE
> +static int vnet_netgraph_idetach(const void *unused)
> +{
> + INIT_VNET_NETGRAPH(curvnet);
> + node_p node, last_killed = NULL;
> +
> + while ((node = LIST_FIRST(&V_ng_nodelist)) != NULL) {
> + if (node == last_killed)
> + panic("netgraph node %s won't die", node->nd_name);
> + ng_rmnode(node, NULL, NULL, 0);
> + last_killed = node;
> + }
> +
> + return 0;
> +}
> +#endif
> +
> static moduledata_t netgraph_mod = {
> "netgraph",
> ngb_mod_event,
More information about the p4-projects
mailing list