From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6eUi-00082J-3r for qemu-devel@nongnu.org; Wed, 09 Dec 2015 08:09:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6eUe-0007TD-So for qemu-devel@nongnu.org; Wed, 09 Dec 2015 08:09:20 -0500 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:35330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6eUe-0007T6-Me for qemu-devel@nongnu.org; Wed, 09 Dec 2015 08:09:16 -0500 Received: by wmuu63 with SMTP id u63so221601887wmu.0 for ; Wed, 09 Dec 2015 05:09:16 -0800 (PST) Sender: Paolo Bonzini References: <87a8pl9hmt.fsf@blackfin.pond.sub.org> <20151208141938.GB2593@work-vm> <87io480y0n.fsf@blackfin.pond.sub.org> From: Paolo Bonzini Message-ID: <566827FC.4080701@redhat.com> Date: Wed, 9 Dec 2015 14:09:16 +0100 MIME-Version: 1.0 In-Reply-To: <87io480y0n.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] Error handling in realize() methods List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , "Dr. David Alan Gilbert" Cc: Peter Maydell , Peter Crosthwaite , qemu-devel@nongnu.org, =?UTF-8?Q?Andreas_F=c3=a4rber?= On 09/12/2015 10:30, Markus Armbruster wrote: > My current working assumption is that passing &error_fatal to > memory_region_init_ram() & friends is okay even in realize() methods and > their supporting code, except when the allocation can be large. I suspect a lot of memory_region_init_ram()s could be considered potentially large (at least in the 16-64 megabytes range). Propagation of memory_region_init_ram() failures is easy enough, thanks to Error**, that we should just do it. Even if we don't, we should use &error_abort, not &error_fatal (programmer error---due to laziness---rather than user error). &error_fatal should really be restricted to code that is running very close to main(). Paolo > Even > then, &error_fatal is better than buggy recovery code (which I can see > all over the place, but that's a separate topic).