On Thu, 29 May 2014 17:28:34 +0200 Paolo Bonzini <pbonz...@redhat.com> wrote:
> Il 29/05/2014 16:22, Peter Crosthwaite ha scritto: > >> > > >> > +bool memory_region_is_mapped(MemoryRegion *mr) > >> > +{ > > Is it not enough to just return mr->parent? Memory mapping assertion > > will happen if you try and map the same twice, even if one of the > > mappings is not contained within an AddressSpace. Checking for just > > the parent mr may be a simpler and more accurate check. > > I can see a difference if the memory region is completely overlapped by > a higher-priority one. Igor, what was your idea with this function? Idea was to let know the caller that it's safe to map this region so mapping won't assert. I guess Peter's suggestion just to check parent should work in this case. > > Paolo -- Regards, Igor