Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
On 12/19/2011 05:28 PM, Avi Kivity wrote: > > > > But it should be at least be documented and used consistently. > > Will update both. Updated patchset in qemu-kvm.git page_desc. Will refrain from reposting until some time has passed for review. -- error compiling committee.c: too many argument

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
On 12/19/2011 05:25 PM, Anthony Liguori wrote: >> I rather like the pattern >> >> void callback(void *_foo) >> { >> Foo *foo = _foo; >> >> ... >> } >> >> If the consensus is that we don't want it, I'll change it, but I do >> think it's useful. > > > I dislike enforci

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Anthony Liguori
On 12/19/2011 09:17 AM, Avi Kivity wrote: On 12/19/2011 05:10 PM, Anthony Liguori wrote: On 12/19/2011 09:04 AM, Avi Kivity wrote: On 12/19/2011 04:50 PM, Anthony Liguori wrote: +static int cmp_flatrange_addr(const void *_addr, const void *_fr) +{ +const AddrRange *addr = _addr; +const

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
On 12/19/2011 05:10 PM, Anthony Liguori wrote: > On 12/19/2011 09:04 AM, Avi Kivity wrote: >> On 12/19/2011 04:50 PM, Anthony Liguori wrote: +static int cmp_flatrange_addr(const void *_addr, const void *_fr) +{ +const AddrRange *addr = _addr; +const FlatRange *fr = _fr;

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Anthony Liguori
On 12/19/2011 09:04 AM, Avi Kivity wrote: On 12/19/2011 04:50 PM, Anthony Liguori wrote: +static int cmp_flatrange_addr(const void *_addr, const void *_fr) +{ +const AddrRange *addr = _addr; +const FlatRange *fr = _fr; Please don't prefix with an underscore. Why not? It's legal acc

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
On 12/19/2011 04:50 PM, Anthony Liguori wrote: >> +static int cmp_flatrange_addr(const void *_addr, const void *_fr) >> +{ >> +const AddrRange *addr = _addr; >> +const FlatRange *fr = _fr; > > > Please don't prefix with an underscore. Why not? It's legal according to the standards, if tha

Re: [Qemu-devel] [PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Anthony Liguori
On 12/19/2011 08:13 AM, Avi Kivity wrote: Given an address space (represented by the top-level memory region), returns the memory region that maps a given range. Useful for implementing DMA. The implementation is a simplistic binary search. Once we have a tree representation this can be optimi

[PATCH 01/23] memory: introduce memory_region_find()

2011-12-19 Thread Avi Kivity
Given an address space (represented by the top-level memory region), returns the memory region that maps a given range. Useful for implementing DMA. The implementation is a simplistic binary search. Once we have a tree representation this can be optimized. Signed-off-by: Avi Kivity --- memory