Change in vdsm[master]: Multiple Gateways[1/2]: add sourceRouting module

asegurap at redhat.com asegurap at redhat.com
Wed Jun 26 08:08:21 UTC 2013


Antoni Segura Puimedon has posted comments on this change.

Change subject: Multiple Gateways[1/2]: add sourceRouting module
......................................................................


Patch Set 25: (4 inline comments)

....................................................
File vdsm/sourceRoute.py
Line 85: 
Line 86:     def _isLibvirtInterfaceFallback(self):
Line 87:         """
Line 88:         Checks whether the device belongs to libvirt when libvirt is not
Line 89:         yet running. To do so, it must check if there is an autostart
When booting up. network.service is ran earlier than libvirtd. Which means that network.service will trigger the dhclient.d hook before libvirt is listening for connections.
Line 90:         network that uses the device.
Line 91:         """
Line 92:         bridged_name = "bridge name='%s'" % self.device
Line 93:         bridgeless_name = "interface dev='%s'" % self.device


Line 92:         bridged_name = "bridge name='%s'" % self.device
Line 93:         bridgeless_name = "interface dev='%s'" % self.device
Line 94:         for filename in iglob('/etc/libvirt/qemu/networks/autostart/'
Line 95:                               'vdsm-*'):
Line 96:             with open(filename, 'r') as xml_file:
Well, I didn't want to put the burden of parsing potentially a lot of xml files when it is not absolutely necessary due to the fact that we know that the string will be as is. I can change it into doing the xml parsing, though.
Line 97:                 xml_content = xml_file.read()
Line 98:                 if bridged_name in xml_content or \
Line 99:                         bridgeless_name in xml_content:
Line 100:                     return True


Line 102: 
Line 103:     def isLibvirtInterface(self):
Line 104:         try:
Line 105:             networks = netinfo.networks()
Line 106:         except libvirtError:  # libvirt is not running yet
Ok, I'll change the comment.
Line 107:             logging.error('Libvirt is not running checking if vdsm owns %s '
Line 108:                           'an alternative way' % self.device)
Line 109:             return self._isLibvirtInterfaceFallback()
Line 110:         trackedInterfaces = [network.get('bridge') or network.get('iface')


Line 114:     def remove(self):
Line 115:         self.configurator.removeSourceRoute(None, None, self.device)
Line 116: 
Line 117: 
Line 118: class DynamicSourceRoute(StaticSourceRoute):
heh. I knew it would raise some eyebrows, it was either this or having a SourceRoute abstract base class (which I don't normally favor). I can change it to that if you prefer.
Line 119:     @staticmethod
Line 120:     def _getRoutes(table, device):
Line 121:         routes = []
Line 122:         for entry in routeShowTable(table):


-- 
To view, visit http://gerrit.ovirt.org/15207
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0224d896724b9cdc44215e92f0da0be71fd19038
Gerrit-PatchSet: 25
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Livnat Peer <lpeer at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list