From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdtrJ-0002TO-Pj for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:41:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZdtrJ-0006C3-1I for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:41:49 -0400 Received: from mail-wi0-x243.google.com ([2a00:1450:400c:c05::243]:34203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZdtrI-0006BT-RW for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:41:48 -0400 Received: by wiku15 with SMTP id u15so19730556wik.1 for ; Sun, 20 Sep 2015 22:41:48 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1442605096-14103-5-git-send-email-ehabkost@redhat.com> References: <1442605096-14103-1-git-send-email-ehabkost@redhat.com> <1442605096-14103-5-git-send-email-ehabkost@redhat.com> Date: Mon, 21 Sep 2015 11:11:47 +0530 Message-ID: From: Bharata B Rao Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v2 4/4] target-i386: Call cpu_exec_init() on realize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Zhu Guihua , "qemu-devel@nongnu.org" , tangchen@cn.fujitsu.com, Gu Zheng , isimatu yasuaki , Igor Mammedov , ChenFan , Paolo Bonzini , Anshul Makkar , =?UTF-8?Q?Andreas_F=C3=A4rber?= On Sat, Sep 19, 2015 at 1:08 AM, Eduardo Habkost 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 ? Regards, Bharata.