Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-23 Thread Dan Smith
JM> However, argv is one place where it pays to relax JM> const-correctness guidelines, at least in C, because so many JM> interfaces require non-const "char **argv" pointers. IMHO, it's JM> better to avoid const altogether in this limited case than to be JM> forced to litter the code with ugly an

Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-21 Thread Jim Meyering
Daniel Veillard <[EMAIL PROTECTED]> wrote: ... >> +int vethCreate(char* veth1, int veth1MaxLen, >> + char* veth2, int veth2MaxLen) >> +{ >> +int rc = -1; >> +const char *argv[] = { > > I think Jim insists on having const char const * [], but I bet he will explain > this better

Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-20 Thread Dave Leskovec
Dan Smith wrote: >>> +if (1 > strlen(veth1)) { > > DL> Why do you check with strlen > 1 ? > > To be honest, I have no idea why Dave did that. I'll check with him > to see if there's something we're missing. It's probably worth a > comment if so. > So that's checking if veth1 is an empty s

Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-20 Thread Dan Smith
>> +#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__) >> +#define DEBUG0(msg) VIR_DEBUG(__FILE__, "%s", msg) DL> Do you know ##__VA_ARGS ? Yes, and I agree this not my preferred way. However, this isn't my code and when I went to look for other instances, I found many so I decided not

Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-20 Thread Daniel Lezcano
Dan Smith wrote: # HG changeset patch # User Dave Leskovec <[EMAIL PROTECTED]> # Date 1213891164 25200 # Node ID 386c067de8995028dd11f70602081c31682dd293 # Parent 8d2afc533c91c4796512e1e71c8283e86eafd18a [LXC] Add functions to manage veth device pairs This gives us the ability to create a veth

Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-20 Thread Daniel Veillard
On Thu, Jun 19, 2008 at 10:46:40AM -0700, Dan Smith wrote: > DV> Hum, it's not only a kernel feature, it looks more like a > DV> dependancy on iproute, maybe that can be checked at runtime when > DV> initializing the lxc module, no ? > > I suppose I could actually let it fail when it tries to do t

Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-19 Thread Dan Smith
DS> # HG changeset patch DS> # User Dave Leskovec <[EMAIL PROTECTED]> DS> # Date 1213891164 25200 DS> # Node ID 386c067de8995028dd11f70602081c31682dd293 DS> # Parent 8d2afc533c91c4796512e1e71c8283e86eafd18a DS> [LXC] Add functions to manage veth device pairs My apologies for the HG headers. I fo

Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-19 Thread Dan Smith
DV> Hum, it's not only a kernel feature, it looks more like a DV> dependancy on iproute, maybe that can be checked at runtime when DV> initializing the lxc module, no ? I suppose I could actually let it fail when it tries to do the actual move. Would you rather a specific test during the define s

Re: [libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-19 Thread Daniel Veillard
On Thu, Jun 19, 2008 at 08:59:52AM -0700, Dan Smith wrote: > # HG changeset patch > # User Dave Leskovec <[EMAIL PROTECTED]> > # Date 1213891164 25200 > # Node ID 386c067de8995028dd11f70602081c31682dd293 > # Parent 8d2afc533c91c4796512e1e71c8283e86eafd18a > [LXC] Add functions to manage veth devic

[libvirt] [PATCH 1 of 3] [LXC] Add functions to manage veth device pairs

2008-06-19 Thread Dan Smith
# HG changeset patch # User Dave Leskovec <[EMAIL PROTECTED]> # Date 1213891164 25200 # Node ID 386c067de8995028dd11f70602081c31682dd293 # Parent 8d2afc533c91c4796512e1e71c8283e86eafd18a [LXC] Add functions to manage veth device pairs This gives us the ability to create a veth pair so that we can