qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] qom: Introduce object_realize_nofail()


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v2] qom: Introduce object_realize_nofail()
Date: Fri, 13 Apr 2012 15:36:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0

Am 13.04.2012 09:17, schrieb Paolo Bonzini:
>> initfn is unable to handle errors btw, which is another reason to do
>> object creations in a second-stage constructor.
> 
> What error handling do you need specifically?  You could add an Error **
> argument to object_{new,initialize{,_with_type} too as soon as you have
> a use for that.

My point was that .instance_init functions always need to succeed
(they're void and have no Error** argument and object_new() does not
return NULL). Allocating a new object in an initfn may fail though.

When at startup, an abort() is considered acceptable. However since Jan
and others are talking about CPU hotplug, having e.g. a PowerPCCPU fail
to initialize its large opcodes table should IMO mid-/long-term not
abort but signal to the user that there was not sufficient memory for
the desired runtime operation. Bad example. Point is, if realize fails
we can delete the object and continue; if something in initfn fails we
currently need to abort. Yes, it's possible to change all initializers,
but not last minute before 1.1 please.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]