xenserver: Fix comment in interface-reconfigure.
[openvswitch] / xenserver / opt_xensource_libexec_InterfaceReconfigureVswitch.py
index 6e5deb7ed8bb926f0fcfeb7203c0d33b3ada02b8..ef3ed090e1b7a6d972928173256aeb7cc5de87c6 100644 (file)
@@ -89,8 +89,9 @@ def pif_currently_in_use(pif):
 
 def pif_datapath(pif):
     """Return the datapath PIF associated with PIF.
-For a non-VLAN PIF, the datapath name is the bridge name.
-For a VLAN PIF, the datapath name is the bridge name for the PIF's VLAN slave.
+A non-VLAN PIF is its own datapath PIF, except that a bridgeless PIF has
+no datapath PIF at all.
+A VLAN PIF's datapath PIF is its VLAN slave's datapath PIF.
 """
     if pif_is_vlan(pif):
         return pif_datapath(pif_get_vlan_slave(pif))
@@ -330,6 +331,7 @@ class DatapathVswitch(Datapath):
         extra_ports = []
 
         pifrec = db().get_pif_record(self._pif)
+        dprec = db().get_pif_record(self._dp)
 
         ipdev = self._ipdev
         bridge = pif_bridge_name(self._dp)
@@ -366,9 +368,9 @@ class DatapathVswitch(Datapath):
 
         # XXX Needs support in ovs-vsctl
         #if bridge == ipdev:
-        #    vsctl_argv += ['--add=bridge.%s.mac=%s' % (bridge, pifrec['MAC'])]
+        #    vsctl_argv += ['--add=bridge.%s.mac=%s' % (bridge, dprec['MAC'])]
         #else:
-        #    vsctl_argv += ['--add=iface.%s.mac=%s' % (ipdev, pifrec['MAC'])]
+        #    vsctl_argv += ['--add=iface.%s.mac=%s' % (ipdev, dprec['MAC'])]
 
         self._vsctl_argv = vsctl_argv
         self._extra_ports = extra_ports