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: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH v2] qom: Introduce object_realize_nofail()
Date: Fri, 13 Apr 2012 09:00:20 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0

On 04/13/2012 08:36 AM, Andreas Färber wrote:
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.

How would it fail?

The instance_init shouldn't have any side effects nor should it be affected by external factors.

Regards,

Anthony Liguori


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





reply via email to

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