Received: from eggs.gnu.org ([2001:4830:134:3::10]:46999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKvOo-00082y-4h for qemu-devel@nongnu.org; Tue, 04 Mar 2014 14:53:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKvOj-0003jt-8E for qemu-devel@nongnu.org; Tue, 04 Mar 2014 14:53:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKvOi-0003jp-VD for qemu-devel@nongnu.org; Tue, 04 Mar 2014 14:53:05 -0500 Date: Tue, 4 Mar 2014 16:53:01 -0300 From: Eduardo Habkost Message-ID: <20140304195301.GZ24353@otherpad.lan.raisama.net> References: <1393313787-890-1-git-send-email-afaerber@suse.de> <1393313787-890-3-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1393313787-890-3-git-send-email-afaerber@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu v10 2/2] target-i386: X86CPU model subclasses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Paolo Bonzini , qemu-devel@nongnu.org, Anthony Liguori , Igor Mammedov On Tue, Feb 25, 2014 at 08:36:27AM +0100, Andreas F=E4rber wrote: > From: Eduardo Habkost >=20 > Register separate QOM types for each x86 CPU model. >=20 > This will allow management code to more easily probe what each CPU mode= l > provides, by simply creating objects using the appropriate class name, > without having to restart QEMU. >=20 > This also allows us to eliminate the qdev_prop_set_globals_for_type() > hack to set CPU-model-specific global properties. >=20 > Instead of creating separate class_init functions for each class, I jus= t > used class_data to store a pointer to the X86CPUDefinition struct for > each CPU model. This should make the patch shorter and easier to review. > Later we can gradually convert each X86CPUDefinition field to lists of > per-class property defaults. >=20 > The "host" CPU model is special, as the feature flags depend on KVM > being initialized. So it has its own class_init and instance_init > function, and feature flags are set on instance_init instead of > class_init. >=20 > Signed-off-by: Andreas F=E4rber > Signed-off-by: Igor Mammedov > Signed-off-by: Eduardo Habkost > Signed-off-by: Andreas F=E4rber For the changes you introduced: Reviewed-by: Eduardo Habkost Tested-by: Eduardo Habkost After hacking the code to allow device_add on CPUs, I could use the classes to instantiate CPUs from different models using device_add (which would be useful to allow probing of CPU model information in a single QEMU instance). --=20 Eduardo