From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHKaS-0006XH-Bl for qemu-devel@nongnu.org; Sun, 06 Dec 2009 12:07:56 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHKaN-0006RL-L3 for qemu-devel@nongnu.org; Sun, 06 Dec 2009 12:07:55 -0500 Received: from [199.232.76.173] (port=44946 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHKaN-0006RB-CT for qemu-devel@nongnu.org; Sun, 06 Dec 2009 12:07:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:9477) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHKaM-0005za-Qx for qemu-devel@nongnu.org; Sun, 06 Dec 2009 12:07:51 -0500 Message-ID: <4B1BE4DA.4000209@redhat.com> Date: Sun, 06 Dec 2009 19:07:38 +0200 From: Avi Kivity MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends References: <4B193DA5.6040507@codemonkey.ws> <4B1A9359.8080305@redhat.com> <4B1A9BF4.2090909@redhat.com> <4B1AE7E3.9000905@collabora.co.uk> <4B1AE8BA.7050207@redhat.com> <4B1AEBE0.4060204@collabora.co.uk> <4B1BACAF.5050203@redhat.com> <4B1BE2BD.900@collabora.co.uk> In-Reply-To: <4B1BE2BD.900@collabora.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ian Molton Cc: Blue Swirl , Paul Brook , Markus Armbruster , qemu-devel@nongnu.org On 12/06/2009 06:58 PM, Ian Molton wrote: > Avi Kivity wrote: > >> On 12/06/2009 01:25 AM, Ian Molton wrote: >> >>> Avi Kivity wrote: >>> >>> >>> >>>> It's not that it doesn't have a way to report failure, it's that it >>>> doesn't fail. Do you prefer functions that fail and report it to >>>> functions that don't fail? >>>> >>>> >>> You have a way of allocating memory that will _never_ fail? >>> >> Sort of. >> > 'sort of' never ? > > >> Did you look at the code? >> > Yes. Its hardly infallible. > It will never fail on Linux. On other hosts it prevents a broken oom handler from taking the guest down a death spiral. >> What about existing usage? Will you audit all the existing calls? >> > mark qemu_malloc as deprecated. don't include new patches that use it. > Plenty of time to fix the broken uses... > Send patches. I don't think it's realistic to handle OOM in qemu (handling n=0 is easy, but a lot of work for no real gain). -- error compiling committee.c: too many arguments to function