Dies schrieb Daniel Lezcano (daniel.lezc...@free.fr): > Are we sure, we want to add these hooks (pre and post) ? I am not > against adding them, but IMO it is more sane to add them if needed > rather than adding something which may not be used.
Well, until now, there was not a single hook, although I desperately needed one. And there are probably people out there who might use these hooks and are not able to add them for themselves. > Wouldn't preferable to have these two hooks: > > lxc.network.script.up > lxc.network.script.down > > (script parameter will need 'name', 'conf section' 'up' | 'down' ... I still advise to split the hooks into generic ones and those specific to the network type. The parameters passed to a script configuring a veth device will be completely different than those passed to a macvlan device; generic commands can then be placed in a different script, while special commands can be handled in specific scripts. I'd at least propose to use two hooks for setting up the interface, on being called in instanciate_* (.up?), passing the arguments suitable to that network type, as well as one generic (.post-up?) > If there is a need for a pre or post hook, we can easily add later: Sure, _we_ probably can, but not the person who might need the patch. There are quite many sysadmins who are masters at shell scripting, but are unable to add such a hook to a C codebase. Not being able to extend the system in an easy fashion would be a huge show stopper for them, just as the lack of scripting was to me. > > + return -1; > > + } else { > > + return 1; /* all is well */ > > > > The convention is '0' means 'no error', why do you return 1 here ? Oh, I probably got the exit codes mixed up, I'll fix it... -- - Wertarbyte EDV-Dienstleistungen - Stefan Tomanek WWW: http://wertarbyte.de/ E-Mail: kont...@wertarbyte.de ------------------------------------------------------------------------------ Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today. http://p.sf.net/sfu/beautyoftheweb _______________________________________________ Lxc-devel mailing list Lxc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-devel