From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0qQM-0004vJ-W5 for qemu-devel@nongnu.org; Tue, 06 Sep 2011 03:50:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R0qQM-0007WL-5s for qemu-devel@nongnu.org; Tue, 06 Sep 2011 03:50:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R0qQL-0007W6-OF for qemu-devel@nongnu.org; Tue, 06 Sep 2011 03:50:26 -0400 Message-ID: <4E65D0BD.4010700@redhat.com> Date: Tue, 06 Sep 2011 10:50:21 +0300 From: Avi Kivity MIME-Version: 1.0 References: <201109010054.53424.michael@walle.cc> <4E5F1E14.3060606@redhat.com> <201109011200.12035.michael@walle.cc> In-Reply-To: <201109011200.12035.michael@walle.cc> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] new memory api: offsets? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Walle Cc: qemu-devel@nongnu.org On 09/01/2011 01:00 PM, Michael Walle wrote: > Am Donnerstag 01 September 2011, 07:54:28 schrieb Avi Kivity: > > On 09/01/2011 01:54 AM, Michael Walle wrote: > > > Hi Avi, > > > > > > while debugging, i noticed, that mr->offset is never set, expect in the > > > initializer. (The subregion collision warning is printed although the > > > regions are not overlapping.) Is this intended? > > > > Did you miss memory_region_set_offset()? > I saw that function but it's never called. Now i noticed that this is a > deprecated public function. > > > The subregion collision warning is unrelated? > you are walking along the subregions and use that offset property to detect > collisions. Shouldn't you use the addr property instead? Ah, of course. > > @@ -1190,16 +1190,18 @@ 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; > } Right. Please post with a changelog and signoff. > > > > btw. you may include the memory region name in the warning. > > > > sure, patches welcome. > > - 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); > > let me know if i should post a git patch instead :) > Yes, with a signoff. -- error compiling committee.c: too many arguments to function