<div dir="ltr">Hi,<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jul 11, 2013 at 5:39 PM, Dwight Engen <span dir="ltr"><<a href="mailto:dwight.engen@oracle.com" target="_blank">dwight.engen@oracle.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 11 Jul 2013 16:22:11 -0500<br>
<div><div>Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>> wrote:<br>
<br>
> Quoting Dwight Engen (<a href="mailto:dwight.engen@oracle.com" target="_blank">dwight.engen@oracle.com</a>):<br>
> > On Thu, 11 Jul 2013 15:40:10 -0500<br>
> > Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>> wrote:<br>
> ><br>
> > > Quoting Dwight Engen (<a href="mailto:dwight.engen@oracle.com" target="_blank">dwight.engen@oracle.com</a>):<br>
> > > > On Thu, 11 Jul 2013 14:48:21 -0500<br>
> > > > Serge Hallyn <<a href="mailto:serge.hallyn@ubuntu.com" target="_blank">serge.hallyn@ubuntu.com</a>> wrote:<br>
> > > ><br>
> > > > > lxc-create ... -o -<br>
> > > > ><br>
> > > > > will send template output to standard output (the old<br>
> > > > > default).<br>
> > > > ><br>
> > > > > lxc-create ... without any -o will hide template output.<br>
> > > > ><br>
> > > > > lxc-create -o /tmp/xxx will send template output to the file<br>
> > > > > /tmp/xxx.<br>
> > > ><br>
> > > > I like having a -o for lxc-create, but I'm not sure we should<br>
> > > > change the<br>
> > ><br>
> > > Sorry, that was wrong in my commit msg.<br>
> > ><br>
> > > only '--outfile' works (because 'o' is used by the common options<br>
> > > for logfile output)<br>
> > ><br>
> > > > default of lxc-create to not show the template output. For<br>
> > > > interactive<br>
> > ><br>
> > > We could swap the meanings so that '--outfile -' means on output,<br>
> > > and not listing '--outfile' shows the output on stdout.<br>
> ><br>
> > Sorry, I'm not getting the difference between --outfile - and just<br>
> > getting output on stdout? My main concern was that lxc-create<br>
> > without any extra args do what it does today (shows output).<br>
><br>
> With this current patch:<br>
><br>
>       lxc-create with no extra args does not show output<br>
>       "lxc-create --outfile -" shows output to stdout<br>
><br>
> I'm suggesting we just flip those.<br>
<br>
</div></div>Ahh, yep, I'd like it better flipped then as the no args case won't<br>
change today's behavior, but if others feel strongly I don't really<br>
care too much. So this is what I think you're proposing:<br>
<br>
 lxc-create with no extra args -> shows output on stdout<br>
 lxc-create --outfile -        -> shows output on stdout<br>
 lxc-create --outfile /tmp/xxx -> output in /tmp/xxx</blockquote><div><br></div><div>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</div>

<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
> > > > use it can be quite useful, whereas I think silent certainly<br>
> > > > makes sense for the API (which is what I think Çağlars original<br>
> > > > concern was).<br>
> > ><br>
> > > Oh, hm, yeah.  So my approach actually doesn't suffice.  I was<br>
> > > thinking callers could do the same thing, but that's somewhat<br>
> > > silly.<br>
> > ><br>
> > > > Maybe the API should take fds which we can dup2() onto 0,1,2 of<br>
> > > > the forked create process to handle both cases? (and would<br>
> > > > allow the API to capture the output if so desired)<br>
> > ><br>
> > > pass in an int* which is either NULL or contains 3 ints (i.e.<br>
> > > -1, 10, 10 if 10 is an output file)?<br>
> ><br>
> > Yeah I think that would work, or 3 separate ints like we do for<br>
> > lxcapi_console(). Either way, if the caller passes -1, does that<br>
> > mean we would use the callers existing stdin,out,err i.e. don't<br>
> > dup2() that fd<br>
><br>
> I was thinking -1 would mean leave that fd alone, but<br>
><br>
> > at all, or that we will ensure stdin,out,err are /dev/null? The<br>
> > later is probably easier for API callers and lxc-create can just<br>
> > pass the fd's it wants.<br>
><br>
> Agreed, that seems to make sense.<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>S.Çağlar Onur <<a href="mailto:caglar@10ur.org" target="_blank">caglar@10ur.org</a>>
</div></div>