On Wed, Dec 12, 2012 at 12:48:44AM +0100, Thomas Graf wrote:
> When adding a new port or bond, save the port name and check
> the "ofport" column of that port after the database has been
> reloaded. It will contain OFPP_NONE (-1) if the addition
> process failed inside the bridge.
OFPP_NONE isn't -1.
This test is bizarre (and will fail on big-endian systems):
*((uint16_t *) iface->ofport) == OFPP_NONE)
Just write "iface->ofport < 0".
> Print an error message and exit ovs-vsctl with -EFAULT in that case.
-EFAULT is not a reasonable program exit status.
> Note that this is not 100% reliable. Another user may have
> modified the database which may have caused the port addition
> to fail.
>
> Cc: Ben Pfaff <[email protected]>
> Signed-off-by: Thomas Graf <[email protected]>
I don't think this is general enough. It only checks a single port in
one run, but ovs-vsctl supports an arbitrary number of commands. It
also should check for the new port using the UUID reported by the
database server, rather than by name. I'd also want it to properly
handle cases like:
ovs-vsctl -- add-port br0 eth0 -- del-port eth0
that is, without giving an error.
It is also possible to expand this, without much extra effort, from
just adding port to also adding bridges, since one can check that the
bridge port comes up properly.
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev