Change in vdsm[master]: netlink: User libnl-3 when available

asegurap at redhat.com asegurap at redhat.com
Tue Apr 22 13:06:17 UTC 2014


Antoni Segura Puimedon has posted comments on this change.

Change subject: netlink: User libnl-3 when available
......................................................................


Patch Set 7:

(2 comments)

http://gerrit.ovirt.org/#/c/26514/7/lib/vdsm/netlink.py
File lib/vdsm/netlink.py:

Line 225: _char_proto = CFUNCTYPE(c_char_p, c_void_p)
Line 226: _void_proto = CFUNCTYPE(c_void_p, c_void_p)
Line 227: _none_proto = CFUNCTYPE(None, c_void_p)
Line 228: 
Line 229: if not _ethtool_uses_libnl3():  # libnl-1
> Using:
IIRC it was to comply with your suggestion in a previous comment that said to put first libnl-1, then libnl-3 and finally common things.

I can change it and will do so.
Line 230:     # Change from handle to socket as it is now more accurately called in
Line 231:     # libnl-3
Line 232:     LIBNL_ROUTE = LIBNL = CDLL('libnl.so.1', use_errno=True)
Line 233: 


Line 260:     _link_is_vlan = _int_proto(('rtnl_link_is_vlan', LIBNL_ROUTE))
Line 261:     _vlan_get_id = _int_proto(('rtnl_link_vlan_get_id', LIBNL_ROUTE))
Line 262: 
Line 263:     def _rtnl_link_alloc_cache(sock):
Line 264:         """Wraps the new link alloc cache to expose the libnl1 signature"""
> Since libnl1 will be eliminate eventually, shouldn't we use libnl3 signatur
It's a matter of simplicity. I do not want to have a python wrapper that receives a AF_UNSPEC and, above all, a reference to a pointer (cache). The libnl1 signature is much more pythonic, and that's why I kept it.
Line 265:         AF_UNSPEC = 0
Line 266:         cache = c_void_p()
Line 267:         err = _link_alloc_cache(sock, AF_UNSPEC, byref(cache))
Line 268:         if err:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I45f043a8416e57d5fb550e2e817e6df38cd793b1
Gerrit-PatchSet: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer 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