From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9y2P-0000Wa-Vf for qemu-devel@nongnu.org; Fri, 29 May 2009 05:06:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9y2K-0000ML-N4 for qemu-devel@nongnu.org; Fri, 29 May 2009 05:06:05 -0400 Received: from [199.232.76.173] (port=52301 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9y2K-0000M2-Id for qemu-devel@nongnu.org; Fri, 29 May 2009 05:06:00 -0400 Received: from mail-ew0-f213.google.com ([209.85.219.213]:60992) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9y2J-0007mi-RM for qemu-devel@nongnu.org; Fri, 29 May 2009 05:06:00 -0400 Received: by ewy9 with SMTP id 9so5595899ewy.34 for ; Fri, 29 May 2009 02:05:58 -0700 (PDT) Message-ID: <4A1FA573.4010602@codemonkey.ws> Date: Fri, 29 May 2009 04:05:55 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] use qemu_malloc and friends consistently References: <200905290758.11551.jcd@tribudubois.net> <4A1F9FFE.3030100@redhat.com> In-Reply-To: <4A1F9FFE.3030100@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paul Brook , qemu-devel@nongnu.org, Jean-Christophe Dubois Kevin Wolf wrote: > Since recently qemu_malloc behaves differently from malloc with size = > 0. This isn't allowed any more with qemu_malloc. So you need to check > for pattern_count == 0 and either print an error message or malloc a > different size, e.g. 1. I'm sure we don't want qemu-io to abort() in > such a case. > > Or we could start over with a lengthy discussion about fixing qemu_malloc... > Having qemu_malloc(0) abort is silly. Returning NULL or returning malloc(1) are both reasonable options. Putting the abort() in there is going to introduce a ton of subtle bugs, I vote for changing qemu_malloc() to have a sane behavior. Regards, Anthony Liguori > Kevin > > >