sysctl-controlled key-value store ?

From: Luigi Rizzo <rizzo_at_iet.unipi.it>
Date: Sat, 6 Oct 2012 19:28:34 +0200
Hi,
in order to control some netmap feature (namely, which interfaces
are attached to VALE switches), i would considering the use of
a sysctl interface triggering a sysctl-proc, something of the form

	dev.netmap.switch.xyz=em0 ix1
	dev.netmap.switch.foo=ix2 re0

where "xyz" and "foo" are the names of the netmap switch instances.
Thing is, right now those names are created dynamically when users
configure a netmap port, and I would like to have the same dynamic
behaviour with the sysctl, so that an access to a not-yet-existent
dev.netmap.switch.xyz node should both create the node and add a value.

Is this possible (either now or with a modest modification to the sysctl
infrastructure) ?
Or should I use a workaround, say have a sysctl node that acts
as a 'gate' and the procedure will create (readonly) values e.g.

dev.netmap.switch.config="xyz: em0 ix1" # creates dev.netmap.switch.xyz=em0 ix1
dev.netmap.switch.config="xyz: ix1"	# updates dev.netmap.switch.xyz=ix1
dev.netmap.switch.config="xyz:"		# deletes dev.netmap.switch.xyz=

cheers
luigi
Received on Sat Oct 06 2012 - 15:17:16 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:31 UTC