From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40402 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P5fr4-00074i-Ts for qemu-devel@nongnu.org; Tue, 12 Oct 2010 10:29:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P5fr3-0003Na-SI for qemu-devel@nongnu.org; Tue, 12 Oct 2010 10:29:26 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:42795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P5fr3-0003NV-PP for qemu-devel@nongnu.org; Tue, 12 Oct 2010 10:29:25 -0400 Received: by qyk36 with SMTP id 36so715697qyk.4 for ; Tue, 12 Oct 2010 07:29:25 -0700 (PDT) Message-ID: <4CB46F85.8060007@codemonkey.ws> Date: Tue, 12 Oct 2010 09:24:05 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] qdev: Some ISA devices don't handle second instantiation gracefully References: <4CB46239.60500@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, "H. Peter Anvin" , Gerd Hoffmann , Alexander Graf , "Richard W. M. Jones" On 10/12/2010 08:54 AM, Markus Armbruster wrote: > >> I think the proper thing to do is remove all exit(1)s and propagate >> errors instead. >> > exit() is good enough during startup, i.e. -device. It's wrong for hot > plug; anything to be used in a hot plug path must propagate errors. We > could keep exiting in code that's only used by non-hotpluggable devices. > I'm not really suggesting that we move exit()s out of all devices right now. Am just suggesting that we bump them up one level. >> A simple approach would be to make register_ioport_{read,write}() >> return an int, then do a query-replace on the source tree to make all >> invocations of it simply check the return value and exit if it's >> non-zero. >> > In similar cases, we've used a simple FOO_nofail() wrapper in places > that want to exit. > > I'll see what I can do. > I prefer propagating the exit but am not deeply opposed to nofail(). Regards, Anthony Liguori