[ovs-dev] xenserver: use ovs-vsctl for VIF VLAN configuration instead of /var/lib/openvswitch/br-*

Ben Pfaff blp at nicira.com
Thu Oct 15 22:44:54 UTC 2009


Ian Campbell <Ian.Campbell at eu.citrix.com> writes:

> On Mon, 2009-10-05 at 18:15 +0100, Ben Pfaff wrote:
>> I think that ovs-vsctl should probably support multiple
>> operations in one go.  I have two notions about how that might
>> work.  One, there could be a separator argument between commands,
>> say "," or "--".  Two, ovs-vsctl could accept commands from
>> stdin, one per line, if "-" was given as its argument, or perhaps
>> from a command file with, say, "-f <filename>".  I think I like
>> the latter better.
>
> I'm not sure which is easier to script. I guess it comes down to:
>         ovs-vsctl CMD1 args1 -- CMD2 args2
> vs
>         ovs-vsctl -f - <<EOF
>         CMD1 args1
>         CMD2 args2
>         EOF
> (I don't think creating a temporary file and using -f on it is terribly
> useful in this context but I guess little precanned snippets are a
> possibility)
>
> For the later constructing "CMD1 args\nCMD2 args" in shell could involve
> some tricky quoting (not exactly rocket science, but still). So perhaps
> it is worth allowing ';' as well as '\n' as a separator. At which point
> the two forms become almost equivalent in both usage and, I suspect,
> implementation:
>         ovs-vsctl "CMD1 args1; CMD2 args2"
> and
>         ovs-vsctl -f - <<EOF
>         CMD1 args1;
>         CMD2 args2;
>         EOF
> so why not support both?
>
> It might be worth supporting "--" in its common usage of separating
> options from the rest of the command line?

In the end, I decided that -- on the command line for multiple
operations makes sense.  It's still compatible with the common
usage, as long as either the first non-option argument also
terminates the set of options or you put -- before the first
command.

We can add a -f option too, if you want it, but then we also have
to think about whether there's any need to support quoting of
spaces within the command file; the shell nicely takes care of
that for us for the command line.

I've posted a 3-patch series that implements this in the final
patch.




More information about the dev mailing list