[lxc-devel] [PATCH] add lxc.network.veth.script configuration hook

Stefan Tomanek stefan at pico.ruhr.de
Thu Oct 7 10:32:07 UTC 2010


Dies schrieb Daniel Lezcano (daniel.lezcano at free.fr):

> I suggest you add a lxc.network.script section where it will be
> called from each instanciate_*

OK, that's what an earlier version of the patch did, so I partially
reverted :-)

> The script should receive always the two parameters:
> 
>     $1 : container name
>     $2 : configuration section : "network", "pts", etc ...

What is the easiest way to retrieve the container name from inside
instanciate_*? All it gets passed have is the lxc_netdev struct,
and I'd like to avoid changing several signatures.

> And the optional parameters depending of the hooks caller:
> 
> In your case:
>     $3 : network type "veth", ...
>     $4 : network link
>     $5 : guest ifname
>     $6 : host ifname (in case of veth)

Is the guest ifname really useful? The script runs in the context of
the host, what can be achieved with it?

> use the /* */ format to conform to the Coding Style please.

OK, that was an easy change...

> >+		return status;
> 
> Do we assume the script returns always 0 on success ? and we don't
> care about the WIFSIGNALED, ... ?

I'd suggest that a non-zero exit value indicates some kind of problem
with the network configuration and should abort the network setup.

Thanks for your feedback, I'll see what I can do about it :)




More information about the lxc-devel mailing list