Received: from eggs.gnu.org ([208.118.235.92]:50117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uccom-0000b8-LL for qemu-devel@nongnu.org; Wed, 15 May 2013 10:36:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uccof-0000Fj-SD for qemu-devel@nongnu.org; Wed, 15 May 2013 10:36:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uccof-0000EV-JP for qemu-devel@nongnu.org; Wed, 15 May 2013 10:36:29 -0400 From: Markus Armbruster References: <1368454796-14989-1-git-send-email-pbonzini@redhat.com> <1368454796-14989-3-git-send-email-pbonzini@redhat.com> Date: Wed, 15 May 2013 16:36:27 +0200 In-Reply-To: <1368454796-14989-3-git-send-email-pbonzini@redhat.com> (Paolo Bonzini's message of "Mon, 13 May 2013 16:19:56 +0200") Message-ID: <874ne4b990.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH for-1.5 2/2] osdep: introduce qemu_anon_ram_free to free qemu_anon_ram_alloc-ed memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, aliguori@us.ibm.com, akong@redhat.com, qemu-devel@nongnu.org This patch would break the build for me, if I didn't configure --disable-werror. Using --enable-trace-backend=stderr in case it makes a difference. Troublemaker flagged inline. Paolo Bonzini writes: > We switched from qemu_memalign to mmap() but then we don't modify > qemu_vfree() to do a munmap() over free(). Which we cannot do > because qemu_vfree() frees memory allocated by qemu_{mem,block}align. > > Introduce a new function that does the munmap(), luckily the size is > available in the RAMBlock. [...] > diff --git a/trace-events b/trace-events > index acf0f5c..c7dbcf0 100644 > --- a/trace-events > +++ b/trace-events > @@ -34,6 +34,7 @@ g_free(void *ptr) "ptr %p" > qemu_memalign(size_t alignment, size_t size, void *ptr) "alignment %zu size %zu ptr %p" > qemu_anon_ram_alloc(size_t size, void *ptr) "size %zu ptr %p" > qemu_vfree(void *ptr) "ptr %p" > +qemu_anon_ram_free(void *ptr, size_t size) "size %zu ptr %p" In file included from /work/armbru/qemu/include/trace.h:4:0, from /work/armbru/qemu/util/osdep.c:49: ./trace/generated-tracers.h: In function 'trace_qemu_anon_ram_free': ./trace/generated-tracers.h:64:9: warning: format '%zu' expects argument of type 'size_t', but argument 3 has type 'void *' [-Wformat] ./trace/generated-tracers.h:64:9: warning: format '%p' expects argument of type 'void *', but argument 4 has type 'size_t' [-Wformat] > > # hw/virtio.c > virtqueue_fill(void *vq, const void *elem, unsigned int len, unsigned int idx) "vq %p elem %p len %u idx %u" [...]