[lxc-devel] [PATCH] lxc_create: add outfile option

Dwight Engen dwight.engen at oracle.com
Fri Jul 12 10:54:56 UTC 2013


On Thu, 11 Jul 2013 23:55:36 -0500
Serge Hallyn <serge.hallyn at ubuntu.com> wrote:

> Quoting S.Çağlar Onur (caglar at 10ur.org):
> > Hi,
> > 
> > 
> > On Thu, Jul 11, 2013 at 5:39 PM, Dwight Engen
> > <dwight.engen at oracle.com>wrote:
> > 
> > > On Thu, 11 Jul 2013 16:22:11 -0500
> > > Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> > >
> > > > Quoting Dwight Engen (dwight.engen at oracle.com):
> > > > > On Thu, 11 Jul 2013 15:40:10 -0500
> > > > > Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> > > > >
> > > > > > Quoting Dwight Engen (dwight.engen at oracle.com):
> > > > > > > On Thu, 11 Jul 2013 14:48:21 -0500
> > > > > > > Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> > > > > > >
> > > > > > > > lxc-create ... -o -
> > > > > > > >
> > > > > > > > will send template output to standard output (the old
> > > > > > > > default).
> > > > > > > >
> > > > > > > > lxc-create ... without any -o will hide template output.
> > > > > > > >
> > > > > > > > lxc-create -o /tmp/xxx will send template output to the
> > > > > > > > file /tmp/xxx.
> > > > > > >
> > > > > > > I like having a -o for lxc-create, but I'm not sure we
> > > > > > > should change the
> > > > > >
> > > > > > Sorry, that was wrong in my commit msg.
> > > > > >
> > > > > > only '--outfile' works (because 'o' is used by the common
> > > > > > options for logfile output)
> > > > > >
> > > > > > > default of lxc-create to not show the template output. For
> > > > > > > interactive
> > > > > >
> > > > > > We could swap the meanings so that '--outfile -' means on
> > > > > > output, and not listing '--outfile' shows the output on
> > > > > > stdout.
> > > > >
> > > > > Sorry, I'm not getting the difference between --outfile - and
> > > > > just getting output on stdout? My main concern was that
> > > > > lxc-create without any extra args do what it does today
> > > > > (shows output).
> > > >
> > > > With this current patch:
> > > >
> > > >       lxc-create with no extra args does not show output
> > > >       "lxc-create --outfile -" shows output to stdout
> > > >
> > > > I'm suggesting we just flip those.
> > >
> > > Ahh, yep, I'd like it better flipped then as the no args case
> > > won't change today's behavior, but if others feel strongly I
> > > don't really care too much. So this is what I think you're
> > > proposing:
> > >
> > >  lxc-create with no extra args -> shows output on stdout
> > >  lxc-create --outfile -        -> shows output on stdout
> > >  lxc-create --outfile /tmp/xxx -> output in /tmp/xxx
> > 
> > 
> > What about adding a quiet parameter instead? It can silence the
> > output and default will write to stdout, this way people who wants
> > output file can redirect stdout to file as well
> 
> If by 'instead' you mean not passing in fds at all and just adding
> a quiet parameter, and by redirect stdout you mean 'lxc-create ... >
> outout', then I like that better for being simpler to do.
> 
> But I'll do whichever of those is preferred.  Will passing in fds add
> flexbility that anyone actually will *want*?  (My feeling tbh is no)
> 
> -serge

Sounds fine to me, assuming you mean a parameter to the API and not
just to lxc-create otherwise it doesn't fix the original problem.




More information about the lxc-devel mailing list