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

Daniel Lezcano dlezcano at fr.ibm.com
Thu Oct 7 11:51:00 UTC 2010


On 10/07/2010 12:32 PM, Stefan Tomanek wrote:
> 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.

Hmm, I think you will have to pass the parameter from lxc_create_network 
to the instanciate*.


>> 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?

Right, and as it will be moved to the container right after, the name, 
ip addresses, routes etc ... will be flushed, that does not really make 
sense and can lead some confusion for the user if it expect to do 
something 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 :)





















































Sauf indication contraire ci-dessus:
Compagnie IBM France
Siège Social : Tour Descartes, 2, avenue Gambetta, La Défense 5, 92400
Courbevoie
RCS Nanterre 552 118 465
Forme Sociale : S.A.S.
Capital Social : 542.737.118 ?
SIREN/SIRET : 552 118 465 02430




More information about the lxc-devel mailing list