Change in vdsm[master]: link monitor: Add optional asynchronous operation

nsoffer at redhat.com nsoffer at redhat.com
Sun Nov 24 14:53:52 UTC 2013


Nir Soffer has posted comments on this change.

Change subject: link monitor: Add optional asynchronous operation
......................................................................


Patch Set 4:

(1 comment)

....................................................
File lib/vdsm/ipwrapper.py
Line 597:         ep = select.epoll()
Line 598:         ep.register(self.proc.stdout, select.EPOLLIN)
Line 599:         fd, event = ep.poll()[0]
Line 600:         outBuffer = os.read(fd, 1024)
Line 601:         while self.proc is not None:
This may be little more efficient:

    pos = outBuffer.find('\n')
    if pos != -1:
        line = outBuffer[:pos + 1]
        outBuffer = outBuffer[pos + 1:]
        yield line
Line 602:             if '\n' in outBuffer:
Line 603:                 line, outBuffer = outBuffer.split('\n', 1)
Line 604:                 yield line + '\n'
Line 605:             else:


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib8ca850fc324a5b4c0268541fd4d4d062706a159
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: 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: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list