diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2010-06-04 16:39:10 +0100 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-06-04 10:20:36 -0700 |
commit | 823c5699d4de7bf726f988e1ca6197fb2400f388 (patch) | |
tree | b37c8e5e4c968ef2f2032d5acdbb5df1d1f88edb /xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py | |
parent | 169e3808f7c510a048589d8e658336919079a6a0 (diff) |
interface-reconfigure: callout to datapath backend class method on rewrite
Use this mechanism to allow the vswitch backend to update the vswitch
configuration's mapping from datapath to XenAPI datamodel Network
UUIDs. The vswitch needs a mechanism to update these when they change
(i.e. on pool join and eject).
Refactor the DatapathFactory method to return the class which the
caller can instantiate or not as the require.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py')
-rw-r--r-- | xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py index b102886e..a4b9da75 100644 --- a/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py +++ b/xenserver/opt_xensource_libexec_InterfaceReconfigureVswitch.py @@ -358,6 +358,17 @@ class DatapathVswitch(Datapath): log("Configured for Vswitch datapath") + @classmethod + def rewrite(cls): + vsctl_argv = [] + for pif in db().get_all_pifs(): + pifrec = db().get_pif_record(pif) + if not pif_is_vlan(pif) and pifrec['currently_attached']: + vsctl_argv += set_br_external_ids(pif) + + if vsctl_argv != []: + datapath_modify_config(vsctl_argv) + def configure_ipdev(self, cfg): cfg.write("TYPE=Ethernet\n") |