[ovs-dev] [PATCH v2 3/6] ovs-xapi-sync: Add unixctl support.
Ethan Jackson
ethan at nicira.com
Fri Mar 9 21:18:20 UTC 2012
Fine with me, I've changed it in both patches.
Ethan
On Fri, Mar 9, 2012 at 12:20, Ben Pfaff <blp at nicira.com> wrote:
> On Thu, Mar 08, 2012 at 03:53:23PM -0800, Ethan Jackson wrote:
>> iface_ids = {} # Map from xs-vif-uuid to iface-id
>> vm_ids = {} # Map from xs-vm-uuid to vm-id
>> seqno = idl.change_seqno # Sequence number when we last processed the db
>> - while True:
>> + while not exiting:
>> idl.run()
>> + unixctl_server.run()
>> if not force_run and seqno == idl.change_seqno:
>> poller = ovs.poller.Poller()
>> +
>> + unixctl_server.wait(poller)
>> idl.wait(poller)
>> +
>> + if exiting:
>> + poller.immediate_wake()
>> +
>> poller.block()
>> continue
>
> I believe that your code is correct, but unixctl_server.run() is what
> is going to set "exiting", so I'd be inclined to write it as:
>
> while True:
> unixctl_server.run()
> if exiting:
> break
>
> idl.run()
> if not force_run and seqno == idl.change_seqno:
> poller = ovs.poller.Poller()
> unixctl_server.wait(poller)
> idl.wait(poller)
> poller.block()
> continue
>
> Thanks,
>
> Ben.
More information about the dev
mailing list