From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQP0o-00032F-1U for qemu-devel@nongnu.org; Fri, 23 Jan 2009 11:36:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQP0m-0002yv-47 for qemu-devel@nongnu.org; Fri, 23 Jan 2009 11:36:05 -0500 Received: from [199.232.76.173] (port=58399 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQP0l-0002yZ-N9 for qemu-devel@nongnu.org; Fri, 23 Jan 2009 11:36:03 -0500 Received: from mail-gx0-f12.google.com ([209.85.217.12]:64450) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LQP0l-0001sv-Ej for qemu-devel@nongnu.org; Fri, 23 Jan 2009 11:36:03 -0500 Received: by gxk5 with SMTP id 5so1411960gxk.10 for ; Fri, 23 Jan 2009 08:36:02 -0800 (PST) Message-ID: <4979F1E3.2050701@codemonkey.ws> Date: Fri, 23 Jan 2009 10:35:47 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [6412] linux-user: add qemu_realloc() implementation to unbreak the build ( Gerd Hoffman) References: <761ea48b0901230738j451cd69bqcf4d394950a99b52@mail.gmail.com> In-Reply-To: <761ea48b0901230738j451cd69bqcf4d394950a99b52@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Laurent Desnogues wrote: > On Fri, Jan 23, 2009 at 4:02 PM, Anthony Liguori wrote: > >> Revision: 6412 >> http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6412 >> Author: aliguori >> Date: 2009-01-23 15:02:20 +0000 (Fri, 23 Jan 2009) >> >> Log Message: >> ----------- >> linux-user: add qemu_realloc() implementation to unbreak the build (Gerd Hoffman) >> >> Signed-off-by: Gerd Hoffmann >> Signed-off-by: Anthony Liguori >> >> Modified Paths: >> -------------- >> trunk/linux-user/mmap.c >> >> Modified: trunk/linux-user/mmap.c >> =================================================================== >> --- trunk/linux-user/mmap.c 2009-01-22 22:09:55 UTC (rev 6411) >> +++ trunk/linux-user/mmap.c 2009-01-23 15:02:20 UTC (rev 6412) >> @@ -123,6 +123,19 @@ >> munmap(p, *p); >> } >> >> +void *qemu_realloc(void *ptr, size_t size) >> +{ >> + size_t old_size, copy; >> + void *new_ptr; >> + >> + old_size = *(size_t *)((char *)ptr - 16); >> + copy = old_size < size ? old_size : size; >> + new_ptr = qemu_malloc(size); >> + memcpy(new_ptr, ptr, copy); >> + qemu_free(ptr); >> + return new_ptr; >> +} >> > > Is it really the correct fix? The original error comes from the fact > we compile qemu_iovec_* in cutils.c. Do we really need these > iovec functions for user-mode? > I think the better question is, why isn't linux-user sharing qemu_malloc/qemu_realloc implementations with the system emulation? Regards, Anthony Liguori > Laurent > > >