Ondřej Svoboda has posted comments on this change.

Change subject: netinfo: rework reporting of DHCPv4/6 on network devices
......................................................................


Patch Set 2:

(4 comments)

https://gerrit.ovirt.org/#/c/48399/2/lib/vdsm/netinfo.py
File lib/vdsm/netinfo.py:

Line 545: return iface in ifaces_with_active_leases
> the "family == 4" is not needed here because this logic is not present in 3
It is not needed in the 'else' clause, and the reason is, dhcpv6 is not 
reported in 3.5 yet.


Line 568: _dhcp_used(
        :                          iface, dhcp4, net_attrs) 
> this change introduces a call to _dhcp_used that was already present by the
Yes, it was introduced to master long before the refactoring patch. I only 
decided to use the refactoring patch as the vehicle to backport everything in 
one go to give 3.5 the latest, upstream approach to dealing with the problem, 
rather than having at least three approaches replace each other, while 
introducing functions such as _dhcp_used.


Line 622: _devinfo
> this wasn't changhed since it is not reporting dhcpv4/6 as it is in master,
Exactly. We only started to report dhcpv4/6 for devices (and not just for 
networks) as per Toni's suggestion, that the information would be useful for 
setting up networks in the first place, but wow, this was long ago.


Line 632: def _propose_updates_to_reported_dhcp(network_info, networking):
        :     """
        :     Report DHCPv4 state of a network's topmost device based on the 
network's
        :     configuration, to fix bug #1184497 (DHCP still being reported for 
hours
        :     after a network got static IP configuration, as reporting is 
based on
        :     dhclient leases).
        :     """
        :     updated_networking = dict(bondings={}, bridges={}, nics={}, 
vlans={})
        :     network_device = network_info['iface']
        : 
        :     for devices in ('bridges', 'vlans', 'bondings', 'nics'):
        :         dev_info = networking[devices].get(network_device)
        :         if dev_info:
        :             updated_networking[devices][network_device] = {
        :                 'bootproto4': network_info['bootproto4'],
        :                 'cfg': {'BOOTPROTO': network_info['bootproto4']},
        :             }
        :             break
        : 
        :     return updated_networking
        : 
        : 
        : def _update_reported_dhcp(replacement, networking):
        :     """
        :     For each network device (representing a network), apply updates 
to reported
        :     DHCP-related fields, as prepared by 
_propose_updates_to_reported_dhcp.
        :     """
        :     for device_type, devices in replacement.iteritems():
        :         for device_name, replacement_device_info in 
devices.iteritems():
        :             device_info = networking[device_type][device_name]
        :             device_info['bootproto4'] = 
replacement_device_info['bootproto4']
        :             if replacement_device_info['cfg']:
        :                 
device_info['cfg'].update(replacement_device_info['cfg'])
> this is an exact copy of the code in master? or is there any change?
Almost, but the logic is the same as in master.

Instead of dealing with dhcpv4/6 fields it works with 'bootproto4', which made 
it to 3.5. The name used to be like this initially (well, at the very 
beginning, it was just 'bootproto'). 

I also don't use six here yet, and neither in the 3.6 backport, even though it 
is a dependency.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iaffdc836f8f64ecdc0a7e37ef50c228032f99696
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Ondřej Svoboda <osvob...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Ido Barkan <ibar...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Ondřej Svoboda <osvob...@redhat.com>
Gerrit-Reviewer: Petr Horáček <phora...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to