Change in vdsm[master]: hooks: ovs

danken at redhat.com danken at redhat.com
Wed Apr 29 20:52:59 UTC 2015


Dan Kenigsberg has posted comments on this change.

Change subject: hooks: ovs
......................................................................


Patch Set 7:

(5 comments)

partial review

https://gerrit.ovirt.org/#/c/40312/7/vdsm_hooks/ovs/README
File vdsm_hooks/ovs/README:

Line 1: ovs vdsm hook
Line 2: =============
Line 3
more content needed. How is this enabled (custom network property, custom bond option), what are the assumptions (single ovs instance on the host)

TODO list, to be fixed in follow-up patches:
- hook for before_device_create
- hooks for get_vds_caps/stats


https://gerrit.ovirt.org/#/c/40312/7/vdsm_hooks/ovs/ovs_network_setup.py
File vdsm_hooks/ovs/ovs_network_setup.py:

Line 77:     else:
Line 78:         return set()
Line 79: 
Line 80: 
Line 81: def _nic_counter(networks):
_nic_users(), maybe?
Line 82:     """Transform running config into {nic: set_of_networks}"""
Line 83:     nic_counter = {}
Line 84:     for network, attrs in networks.items():
Line 85:         nic = attrs.get('nic')


Line 79: 
Line 80: 
Line 81: def _nic_counter(networks):
Line 82:     """Transform running config into {nic: set_of_networks}"""
Line 83:     nic_counter = {}
defaultdict(set) is what you really want!
Line 84:     for network, attrs in networks.items():
Line 85:         nic = attrs.get('nic')
Line 86:         if nic is not None:
Line 87:             if nic in nic_counter:


Line 84:     for network, attrs in networks.items():
Line 85:         nic = attrs.get('nic')
Line 86:         if nic is not None:
Line 87:             if nic in nic_counter:
Line 88:                 nic_counter[nic].append(network)
append->add
Line 89:             else:
Line 90:                 nic_counter[nic] = set([network])
Line 91:     return nic_counter
Line 92: 


Line 154:                     non_ovs_bondings[bonding] = attrs
Line 155: 
Line 156:         for bonding, attrs in bondings.items():
Line 157:             if 'remove' not in attrs:
Line 158:                 ovs_bond = 2000 <= _get_num(bonding) <= 3000
better hide this all in one is_ovs_bond(bonding, attr), that could be easily re-written.
Line 159:                 if ovs_bond:
Line 160:                     self.setup_ovs_bonding(bonding, attrs)
Line 161:                 else:
Line 162:                     non_ovs_bondings[bonding] = attrs


-- 
To view, visit https://gerrit.ovirt.org/40312
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id602b6cc87a663424d06c77d1847d2c2d60d289f
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <toni+ovirt at midokura.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list