|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] qdev: Some ISA devices don't handle second instantiation gracefully |
Date: | Tue, 12 Oct 2010 09:24:05 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Lightning/1.0b1 Thunderbird/3.0.8 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |