[ovs-dev] [PATCH] ovsdb-server: Write manager status information to Manager table.
Andrew Evans
aevans at nicira.com
Tue Feb 1 18:50:37 UTC 2011
On 2/1/11 10:30 AM, Andrew Evans wrote:
> On 2/1/11 9:55 AM, Ben Pfaff wrote:
>> What's the reason for doing the update in two phases, first collecting
>> rows in get_remote_rows() and then updating them in the caller? Does
>> this somehow work better than just iterating over the rows and modifying
>> them in a single pass? It looks like this way actually involves more
>> code and more work, so I'm curious about the design motivation here.
>
> I like that it tucks the type-checking grottiness away from
> update_remote_status(), keeping the latter clearer. But it does allocate
> memory, which wouldn't be necessary if it were inline. I'll rework this
> to just return the rows and move the HMAP_FOR_EACH into
> update_remote_status(). Sound ok?
Tried inlining this; it got very ugly. Going to rename get_remote_rows()
to update_remote_rows() and make it call update_remote_row() for each
row. No memory allocation, no extra pass over the rows, much easier to
read and understand.
-Andrew
More information about the dev
mailing list