Dan Kenigsberg has posted comments on this change. Change subject: netlink: event monitor (simple version) ......................................................................
Patch Set 9: Code-Review-1 (4 comments) http://gerrit.ovirt.org/#/c/36197/9//COMMIT_MSG Commit Message: Line 3: AuthorDate: 2014-10-30 18:28:23 +0100 Line 4: Commit: Petr Horáček <[email protected]> Line 5: CommitDate: 2014-12-19 10:11:03 +0100 Line 6: Line 7: netlink: event monitor (simple version) please explain why a netlink-based monitor is better. Line 8: Line 9: Change-Id: I0f4fcfde87ad51eb832f54862371b4da1281826e http://gerrit.ovirt.org/#/c/36197/9/lib/vdsm/netlink/__init__.py File lib/vdsm/netlink/__init__.py: Line 66: _pool = NLSocketPool(_POOL_SIZE) Line 67: Line 68: Line 69: def _open_socket(seq_check=True, callback_function=None): Line 70: """Returns an open netlink socket.""" please document the args and return value of the callback function Line 71: sock = _nl_socket_alloc() Line 72: if sock is None: Line 73: raise IOError(get_errno(), 'Failed to allocate netlink handle') Line 74: http://gerrit.ovirt.org/#/c/36197/9/lib/vdsm/netlink/monitor.py File lib/vdsm/netlink/monitor.py: Line 41: Line 42: Line 43: class Monitor(object): Line 44: """Netlink monitor. Usage: Line 45: Get events collected while the monitor was running: with the poll-based implementation, this option is less trivial (it requires MonitorThread). Since it's not really required by Vdsm, let's drop it and allow only synchronous event. If someone wants to get events in async, he may shoot a new thread for that. Line 46: Line 47: mon = Monitor() Line 48: mon.start() Line 49: .... http://gerrit.ovirt.org/#/c/36197/9/tests/netlinkTests.py File tests/netlinkTests.py: Line 58: if ('dummy_mon_' in event['name'] Line 59: and event['type'] == 'dummy' Line 60: and event['event'] == 'new_link'): Line 61: found = True Line 62: mon.stop() drop this stop(), and you can drop the ugly "except monitor.MonitorError" in the finally clause. Line 63: break Line 64: except KeyError: Line 65: pass Line 66: self.assertTrue(found) -- To view, visit http://gerrit.ovirt.org/36197 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0f4fcfde87ad51eb832f54862371b4da1281826e Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Petr Horáček <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Petr Horáček <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
