From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPWbX-0002jV-GL for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:20:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPWbV-0007ew-OX for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:20:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPWbV-0007ej-4w for qemu-devel@nongnu.org; Tue, 09 Apr 2013 07:20:45 -0400 Message-ID: <5163F97B.9090802@redhat.com> Date: Tue, 09 Apr 2013 13:20:27 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1365172636-28628-1-git-send-email-imammedo@redhat.com> <1365172636-28628-7-git-send-email-imammedo@redhat.com> <20130408201311.GI2719@otherpad.lan.raisama.net> In-Reply-To: <20130408201311.GI2719@otherpad.lan.raisama.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 06/22] cpu: introduce CPUClass.resume() method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: aliguori@us.ibm.com, claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, lcapitulino@redhat.com, jfrei@linux.vnet.ibm.com, yang.z.zhang@intel.com, Igor Mammedov , afaerber@suse.de, lig.fnst@cn.fujitsu.com, rth@twiddle.net Il 08/04/2013 22:13, Eduardo Habkost ha scritto: > So you are initializing a field of CPUClass struct inside a CPU object > initialization function. And that's a function that is not even > converted to QOM yet, and buried inside a non-trivial function call tree > (hence easy to be called at the wrong time if one day we reorder the > initialization steps). > > Can't we do this on class_init(), where it belongs? If we need different > implementations for softmmu/user, we can add a stub for *-user. Yes, please add a stub for the new function and override it in cpus.c. > I think even an explicit #ifdef inside resume_vcpu() would be > preferable to this. Using an #ifdef basically means putting it in exec.c. I'm not sure about that, it seems to fit more in cpus.c. Paolo