From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPucq-0000ur-Q2 for qemu-devel@nongnu.org; Wed, 10 Apr 2013 08:59:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPuco-0004li-MD for qemu-devel@nongnu.org; Wed, 10 Apr 2013 08:59:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPuco-0004lL-D4 for qemu-devel@nongnu.org; Wed, 10 Apr 2013 08:59:42 -0400 Date: Wed, 10 Apr 2013 14:57:51 +0200 From: Igor Mammedov Message-ID: <20130410145751.2730f989@nial.usersys.redhat.com> In-Reply-To: <5163F97B.9090802@redhat.com> 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> <5163F97B.9090802@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Paolo Bonzini Cc: aliguori@us.ibm.com, Eduardo Habkost , claudio.fontana@huawei.com, qemu-devel@nongnu.org, aderumier@odiso.com, lcapitulino@redhat.com, jfrei@linux.vnet.ibm.com, yang.z.zhang@intel.com, afaerber@suse.de, lig.fnst@cn.fujitsu.com, rth@twiddle.net On Tue, 09 Apr 2013 13:20:27 +0200 Paolo Bonzini wrote: > 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. Ok, I'll revert it to a way as it was in RFC http://lists.gnu.org/archive/html/qemu-devel/2013-03/msg03774.html minus crept in cpu_synchronize_post_init() line. There is no much use in introducing resume method when there are only one implementation and stub. > > > 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 >