<br><tt><font size=2>"Daniel P. Berrange" <berrange@redhat.com>
wrote on 03/17/2010 11:00:26 AM:<br>
<br>
<br>
> Please respond to "Daniel P. Berrange"</font></tt>
<br><tt><font size=2>> <br>
> On Wed, Mar 17, 2010 at 10:53:37AM -0400, Stefan Berger wrote:<br>
> > "Daniel P. Berrange" <berrange@redhat.com> wrote
on 03/17/2010 10:40:36 <br>
> > AM:<br>
> > <br>
> > <br>
> > <br>
> > I hadn't thought about calling that function... I would want
to call a <br>
> > function that can handle something like bash scripts, i.e., multiple
<br>
> > concatenated fragments as those shown above just to be more 'efficient'.
<br>
> <br>
> Is it really more efficient ?  If you need to run 20 ebtables
commands,<br>
> then using bash does 1 fork/exec for bash & bash then does another
20<br>
> fork/exec for ebtables.<br>
> <br>
> Alternatively just use virRun() for each ebtables command you just
still<br>
> have 20 fork/execs, without using bash.<br>
> <br>
> > If virRun() can handle that and $? for example would be treated
there as <br>
> > the return value (which I think is bash-dependent), I'd be happy
to call <br>
> > it as well.<br>
> <br>
> I'd think just call virRun once for each ebtables command - virRun
gives<br>
> you back the exit status of the command </font></tt>
<br>
<br><tt><font size=2>Alright. Would it be ok to still gather the ebtables
commands as I do now and afterwards process them in a loop that searches
for a '\n' between the commands and, depending on whether a STOPONERROR
token would be found following a command, would terminate the loop on error
and return the error code. For some commands that are being executed I
may actually tolerate error codes in case for example a user-define ebtables
table is cleared that doesn't exist, but to get the system into an expected
clean state, it's cleared anyways. In that case no or a different token
would be found.</font></tt>
<br>
<br><tt><font size=2> Regards,</font></tt>
<br><tt><font size=2>   Stefan</font></tt>
<br>
<br><tt><font size=2><br>
> <br>
> <br>
> Regards,<br>
> Daniel<br>
> -- <br>
> |: Red Hat, Engineering, London    -o-   </font></tt><a href=http://people.redhat.com/berrange/:|><tt><font size=2>http://people.redhat.com/berrange/:|</font></tt></a><tt><font size=2><br>
> |: </font></tt><a href=http://libvirt.org/><tt><font size=2>http://libvirt.org</font></tt></a><tt><font size=2>
-o- </font></tt><a href="http://virt-manager.org/"><tt><font size=2>http://virt-manager.org</font></tt></a><tt><font size=2>
-o- </font></tt><a href=http://deltacloud.org:|/><tt><font size=2>http://deltacloud.org:|</font></tt></a><tt><font size=2><br>
> |: </font></tt><a href=http://autobuild.org/><tt><font size=2>http://autobuild.org</font></tt></a><tt><font size=2>
       -o-         </font></tt><a href=http://search.cpan.org/~danberr/:|><tt><font size=2>http://search.cpan.org/~danberr/:|</font></tt></a><tt><font size=2><br>
> |: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1
B3DF F742 7D3B 9505 :|<br>
</font></tt>