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