From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxHmA-0001p5-Tt for qemu-devel@nongnu.org; Tue, 14 Feb 2012 07:46:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RxHm2-000060-Kr for qemu-devel@nongnu.org; Tue, 14 Feb 2012 07:46:30 -0500 Received: from mail-pz0-f45.google.com ([209.85.210.45]:42649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RxHm2-00005u-8Q for qemu-devel@nongnu.org; Tue, 14 Feb 2012 07:46:22 -0500 Received: by dadp14 with SMTP id p14so6271990dad.4 for ; Tue, 14 Feb 2012 04:46:21 -0800 (PST) Message-ID: <4F3A5799.2090306@codemonkey.ws> Date: Tue, 14 Feb 2012 06:46:17 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1328884453-1067-1-git-send-email-zwu.kernel@gmail.com> <20120210144115.GI2914@redhat.com> <4F353D75.2050801@weilnetz.de> <4F38ADC7.8080108@weilnetz.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] oslib: make error handling more reasonable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Zhi Yong Wu , Stefan Weil , QEMU Developers On 02/13/2012 05:16 AM, Stefan Hajnoczi wrote: > On Mon, Feb 13, 2012 at 6:29 AM, Stefan Weil wrote: >> Allocating RAM for the emulated machine is perhaps the only >> scenario where a core dump is indeed not reasonable. In most >> other cases, out-of-memory is an indication of a QEMU internal >> problem, so a core dump should be written. > > Allocating guest memory could fail and we should give a reasonable > error and exit with a failure. I think this might be the one case > where we *do* want to handle memory allocation NULL return. In other > words, perhaps we should call memory allocating functions directly > here instead of using the typical QEMU abort-on-failure wrappers. g_try_malloc glib already has a suite of functions for this. Regards, Anthony Liguori > > Stefan >