From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MA3nh-0000El-Md for qemu-devel@nongnu.org; Fri, 29 May 2009 11:15:17 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MA3nd-0000C7-3q for qemu-devel@nongnu.org; Fri, 29 May 2009 11:15:17 -0400 Received: from [199.232.76.173] (port=35422 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MA3nc-0000C1-LM for qemu-devel@nongnu.org; Fri, 29 May 2009 11:15:12 -0400 Received: from srv-05.w4a.fr ([94.23.5.116]:46359 helo=mx1.w4a.fr) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MA3nc-0003bh-9O for qemu-devel@nongnu.org; Fri, 29 May 2009 11:15:12 -0400 Date: Fri, 29 May 2009 16:15:06 +0100 (GMT+01:00) From: jcd@tribudubois.net Message-ID: <9872107.69851243610106203.JavaMail.root@srv-05.w4a.fr> In-Reply-To: <33383337.69831243610071896.JavaMail.root@srv-05.w4a.fr> Subject: Re: [Qemu-devel] [PATCH] use qemu_malloc and friends consistently MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: Kevin Wolf , Gerd Hoffmann , Paul Brook , qemu-devel@nongnu.org ----- "malc" a =C3=A9crit : > On Fri, 29 May 2009, Anthony Liguori wrote: >=20 > >=20 > > I disagree. The wrong reason we introduced oom_check() was because > we > > don't trust people to check returns. Why would we trust them to > check > > size arguments especially when a lot of programmers are not going > to > > check size arguments by convention? > >=20 > > If we really want to fix up code, we can do so in a more benign way. >=20 > > Instead of aborting, let's return malloc(1) and printf a warning.=20 > Then > > we can fix sites without worrying about killing guests. >=20 > Printf a warning saying what exactly? I guess it should say malloc(0) was used with a backtrace to be usefull ... > > If we only have to fixup a few sites, then yeah, we can switch to > > abort(). If it turns out there's a ton of these things and the code > is > > uglier, then we can give up and just accept these semantics. >=20 > We _already_ use abort, and so far only one caller was caught and > taken care of. I am going to throw in a few more potential cases with my proposed patch. B= ut not that many ...