qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 4/4] target-i386: Call cpu_exec_init() on rea


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH v2 4/4] target-i386: Call cpu_exec_init() on realize
Date: Mon, 21 Sep 2015 11:15:12 -0300
User-agent: Mutt/1.5.23 (2014-03-12)

On Mon, Sep 21, 2015 at 11:11:47AM +0530, Bharata B Rao wrote:
> On Sat, Sep 19, 2015 at 1:08 AM, Eduardo Habkost <address@hidden> wrote:
> > QOM instance_init functions are not supposed to have any side-effects,
> > as new objects may be created at any moment for querying property
> > information (see qmp_device_list_properties()).
> >
> > Calling cpu_exec_init() also affects QEMU's ability to handle errors
> > during CPU creation, as some actions done by cpu_exec_init() can't be
> > reverted.
> >
> > Move cpu_exec_init() call to realize so a simple object_new() won't
> > trigger it, and so that it is called after some basic validation of CPU
> > parameters.
> 
> Since you are moving cpu_exec_init() to realize, does it make sense to
> define unrealize and call cpu_exec_exit() from it ?

It does make sense. But it needs to be done more carefully because
currently cpu_exec_exit() is likely to make QEMU crash, and calling it
from unrealize would make the crash triggerable using a QMP qom-set
command.

-- 
Eduardo



reply via email to

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