schema-recipe.rng: add element ovs_bridge

This element represents an Open vSwitch bridge. This element has a
mandatory child element <slaves> that defines which previously defined
interfaces should be connected to the new bridge as ports.

To create VLANs on this bridge we can use the <vlan> elements. This vlan
element is different from the element that defines a linux vlan
interface. This element defines a virtual lan identified by it's
"tag" (a mandatory attribute) that contains ports that are defined in
the <slaves> element in the usual way. It is important to note that one
port can be in multiple vlans, this makes the port a VLAN trunk.

Finally the bridge can define zero or more bonds by child elements
<bond>. These are similar to normal linux bonds, however at the moment
they don't accept any options, only the specification of it's slaves.
These bond slaves MUST be a subset of the bridges slaves!

As usual the <define> tag can be used anywhere.

An example use in a recipe:
<ovs_bridge id="ovs_br">
    <slaves>
        <slave id="t1"/>
        <slave id="t2"/>
    </slaves>
    <vlan tag="1">
        <slaves>
            <slave id="t1"/>
        </slaves>
    </vlan>
    <bond id="mfg">
        <slaves>
            <slave id="t1"/>
            <slave id="t2"/>
        </slaves>
    </bond>
</ovs_bridge>

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
RecipeParser: add support for ovs_bridge element

The slaves of the ovs_bridge are translated to the internal
representation in the same way as slaves of other devices. However
information about vlan tags and bonds is stored in a new "ovs_conf"
field. I added this field to make it relatively simple to add new
features to the recipe schema of ovs_bridges.

In addition to this, the new code checks for conflicts such as
definition of the same bond, enslaving the same port in different bonds
or referencing non-existing ports.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Controller: add support for ovs_conf

This commit adds Controller support for the ovs_conf field introduced in
the previous commit. The data is now propagated into the Interface
object representing the ovs_bridge and will be sent to the slave when
the configure() method is called.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
{Nm, Net}ConfigDevice: add support for OvS bridges

This commit adds the classes NmConfigDeviceOvsBridge and
NetConfigDeviceOvsBridge that represent the configuration of an Open
vSwitch bridge. The Nm class only defines the is_nm_managed method that
is set to return False and check the devices slaves, since NM does not
support OvS configuration.

The Net class takes care of the OvS configuration by calling appropriate
shell commands, at the moment it can handle the creation and destruction
of an OvS bridge, add/remove ports and set their vlan tags and finally
add/remove bonds. This is sufficient for basic support of Open vSwitch.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
InterfaceManager: generate ovs_bridge interface names

Add the "ovs_bridge" interface type to the assign_name method. The ovs
bridges will get names generated as if they were normal bridges.

Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>