[libvirt] PATCH: Remove linked list of clients in favour of an array

Daniel Veillard veillard at redhat.com
Fri Oct 17 12:02:35 UTC 2008


On Fri, Oct 17, 2008 at 11:51:42AM +0100, Daniel P. Berrange wrote:
> More preparation for multi-thread support, this time in the libvirtd
> daemon. This removes the embedded linked list of 'struct qemud_client'
> and replaces it with an explicit array of pointers of client objects.
> This makes per-client locking more practical in a patch to follow.
> This touches suprisingly little code :-)

  +1

  I still think a bunch of shared macros to do the array allocations
would be nice as we convert the structures, with 2 things in mind:
  - the memmove on removal scares me, it's rather complex, I would
    prefer to have it good for once and not look at those anymore
  - would potentially allow to avoid realloc'ing each time we add or
    remove, I have no doubt glibc works very well in such case, but
    other implementations may not be that nice.
Like for the memory allocations, we went though a lot of churn, and
finally settled for macros simplifying everything in the end. Maybe
we can avoid the extra steps this time ;-)

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list