Re: [libvirt] [PATCH 1/4] snapshot: framework for more efficient relation traversal

2011-10-11 Thread Eric Blake
On 10/10/2011 08:39 PM, Daniel Veillard wrote: Okay, agreed then, I was just wondering if more 'canonical' code and data would lead to simpler code and hence easier to debug in case of trouble, but we are already in the optimization phase, so fine :-) ACK I'll wait on your feedback reg

Re: [libvirt] [PATCH 1/4] snapshot: framework for more efficient relation traversal

2011-10-10 Thread Daniel Veillard
On Mon, Oct 10, 2011 at 04:09:07PM -0600, Eric Blake wrote: > On 10/09/2011 08:37 PM, Daniel Veillard wrote: > >>This layout intentionally hardcodes the size of each snapshot, > >>by tracking sibling pointers, rather than having to deal with > >>the headache of yet more memory management by directl

Re: [libvirt] [PATCH 1/4] snapshot: framework for more efficient relation traversal

2011-10-10 Thread Eric Blake
On 10/09/2011 08:37 PM, Daniel Veillard wrote: This layout intentionally hardcodes the size of each snapshot, by tracking sibling pointers, rather than having to deal with the headache of yet more memory management by directly sticking a child[] on each parent. Okay, so you're using a 'first ch

Re: [libvirt] [PATCH 1/4] snapshot: framework for more efficient relation traversal

2011-10-09 Thread Daniel Veillard
On Fri, Oct 07, 2011 at 06:05:54PM -0600, Eric Blake wrote: > No one was using virDomainSnapshotHasChildren, but that was an > O(n) function. Exposing and tracking a bit more metadata for each > snapshot will allow the same query to be made with an O(1) query > of the member field. For single sna

[libvirt] [PATCH 1/4] snapshot: framework for more efficient relation traversal

2011-10-07 Thread Eric Blake
No one was using virDomainSnapshotHasChildren, but that was an O(n) function. Exposing and tracking a bit more metadata for each snapshot will allow the same query to be made with an O(1) query of the member field. For single snapshot operations (create, delete), callers can be trusted to maintai