From: Michael Walle Date: Thu, 15 Sep 2011 21:16:49 +0000 (+0200) Subject: memory: fix subregion collision warning X-Git-Tag: cpu-hotplug-port-v2~2274^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=860329b2513cf754c5f7d5400f7bcf5dd1a44489;p=people%2Faperard%2Fqemu-dm.git memory: fix subregion collision warning Instead of the offset property use the proper addr property to calculate the offsets. Additionally, be a little more verbose on the warning and print the subregion name. Signed-off-by: Michael Walle Signed-off-by: Avi Kivity --- diff --git a/memory.c b/memory.c index 101b67c935..ba74435a9b 100644 --- a/memory.c +++ b/memory.c @@ -1190,16 +1190,19 @@ static void memory_region_add_subregion_common(MemoryRegion *mr, if (subregion->may_overlap || other->may_overlap) { continue; } - if (offset >= other->offset + other->size - || offset + subregion->size <= other->offset) { + if (offset >= other->addr + other->size + || offset + subregion->size <= other->addr) { continue; } #if 0 - printf("warning: subregion collision %llx/%llx vs %llx/%llx\n", + printf("warning: subregion collision %llx/%llx (%s) " + "vs %llx/%llx (%s)\n", (unsigned long long)offset, (unsigned long long)subregion->size, - (unsigned long long)other->offset, - (unsigned long long)other->size); + subregion->name, + (unsigned long long)other->addr, + (unsigned long long)other->size, + other->name); #endif } QTAILQ_FOREACH(other, &mr->subregions, subregions_link) {