[lxc-devel] [PATCH] add lxc.network.script(.pre|.post|) configuration hooks

Michael Tokarev mjt at tls.msk.ru
Fri Oct 8 12:44:30 UTC 2010


Stefan Tomanek wrote:
> Dies schrieb Michael Tokarev (mjt at tls.msk.ru):
[]
>> There's apparently no reason to run a script "before"
>> creating a netdev (pair).  Note that we don't even
>> know which names will be used for the netdevs, at
>> least in general case.
> 
> I know, but there might be a point in executing a point script before
> network configuration in general. I cannot thin of an example right now,
> but Debian has the same distinction for its network configuration.

It occured to me too that you may be following debian network/interfaces.
But this is something else: in the pre-up in debian you may want to
load a NIC driver module for example, so that the interface actually
appears and when it goes to the initialisation stage when ifup runs
tools like ifconfig to configure the IP addresses, the interface is
already here.  In lxc, the whole 'pre-up' stage is always done by
lxc tools (instantiating veth/macvlan/etc device), so there's just
no "pre-up" stage at all.

>> The "during" version makes no sense at all, in my
>> opinion anyway, because we're syncronous, and there's
>> no way to run something "during" the veth creation.
>> So it actually becomes either "before" or "after"
>> anyway.
> 
> It is "during" due to the fact that it is network type specific and
> gets called inside the instanciate_* (veth in this case) function.
> That is the only part where the host-facing interface name is known,
> so calling a general hook afterwards is of no use.

Ok, I'll re-read the patch again...  somehow I understand it
completely differently...

/mjt




More information about the lxc-devel mailing list