[ovs-dev] [PATCH] xenserver: Only put the primary XenServer UUID in default bridge-id

Ethan Jackson ethan at nicira.com
Wed Sep 22 22:51:39 UTC 2010


Btw this breaks two of the interface reconfigure tests which I will be
fixing before I push upstream.

On Wed, Sep 22, 2010 at 15:34, Ethan Jackson <ethan at nicira.com> wrote:
> This patch defensively guarantees that the first id in
> xs-network-uuids will belong to the primary network (as opposed to
> a vlan).  Given that the primary network id comes first, it parses
> xs-network-ids and only copies the primary id to bridge-id when
> monitor-external-ids is run.
>
> Feature #3647
> ---
>  ...ensource_libexec_InterfaceReconfigureVswitch.py |   15 ++++++++++++++-
>  ..._share_openvswitch_scripts_monitor-external-ids |   10 ++++++++--
>  2 files changed, 22 insertions(+), 3 deletions(-)
>
> diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
> index bc311f8..30ec091 100644
> --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
> +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py
> @@ -332,6 +332,7 @@ def set_br_external_ids(pif):
>     dprec = db().get_pif_record(dp)
>
>     xs_network_uuids = []
> +    primary_xs_network_uuid = None
>     for nwpif in db().get_pifs_by_device(pifrec['device']):
>         rec = db().get_pif_record(nwpif)
>
> @@ -342,7 +343,19 @@ def set_br_external_ids(pif):
>         #    log("Network PIF %s not currently attached (%s)" % (rec['uuid'],pifrec['uuid']))
>         #    continue
>         nwrec = db().get_network_record(rec['network'])
> -        xs_network_uuids += [nwrec['uuid']]
> +
> +        uuid = nwrec['uuid']
> +        if pif_is_vlan(nwpif):
> +            xs_network_uuids.append(uuid)
> +        else:
> +            assert(primary_xs_network_uuid == None)
> +            primary_xs_network_uuid = uuid
> +
> +    # We guarantee that the primary pif is first in the list of
> +    # xs_network_uuids.  Therfore we keep track of it separately and prepend it
> +    # when we are finished.
> +    assert(primary_xs_network_uuid)
> +    xs_network_uuids.insert(0, primary_xs_network_uuid)
>
>     vsctl_argv = []
>     vsctl_argv += ['# configure xs-network-uuids']
> diff --git a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids
> index 45b3dd7..2c2844c 100755
> --- a/xenserver/usr_share_openvswitch_scripts_monitor-external-ids
> +++ b/xenserver/usr_share_openvswitch_scripts_monitor-external-ids
> @@ -116,8 +116,14 @@ def update_network_uuids(name, ids):
>
>  def update_bridge_id(name, ids):
>     id = get_bridge_id(name, ids.get("xs-network-uuids"))
> -    if ids.get("bridge-id") != id and id:
> -        set_external_id("Bridge", name, "bridge-id", id)
> +
> +    if not id:
> +        return
> +
> +    primary_id = id.split(";")[0]
> +
> +    if ids.get("bridge-id") != primary_id:
> +        set_external_id("Bridge", name, "bridge-id", primary_id)
>
>  def update_iface_id(name, ids):
>     id = get_iface_id(name, ids.get("xs-vif-uuid"))
> --
> 1.7.3
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org
>




More information about the dev mailing list