<br><tt><font size=2>"Daniel P. Berrange" <berrange@redhat.com>
wrote on 03/17/2010 11:00:26 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.</font></tt>
<br>
<br><tt><font size=2>I converted some of the code to use virRun() rather
than writing the script and running it. This works with the ebtables level
code but on iptables I do have some fragments that are real scripts testing
for example whether jumps into user define iptables chains exists in the
FORWARD table and only create the jump entries if they don't exist and
take other corrective actions. Those scripts use pipes with grep and gawk
and also use grep'ed return values. So I am not sure what to do about those,
but would prefer to keep them as they are...</font></tt>
<br>
<br><tt><font size=2>   Stefan</font></tt>
<br><tt><font size=2><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 <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>