Received: from eggs.gnu.org ([208.118.235.92]:44723) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZSGO-0007Wq-VY for qemu-devel@nongnu.org; Mon, 06 May 2013 16:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZSG9-0005CJ-P3 for qemu-devel@nongnu.org; Mon, 06 May 2013 16:44:00 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48364 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZSG9-0005C6-I4 for qemu-devel@nongnu.org; Mon, 06 May 2013 16:43:45 -0400 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0328FA398F for ; Mon, 6 May 2013 22:43:45 +0200 (CEST) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 6 May 2013 22:43:28 +0200 Message-Id: <1367873011-7402-9-git-send-email-afaerber@suse.de> In-Reply-To: <1367873011-7402-1-git-send-email-afaerber@suse.de> References: <1367873011-7402-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 08/11] target-i386: Emulate X86CPU subclasses for global properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= After initializing the object from its x86_def_t and before setting any additional -cpu arguments, set any global properties for the designated subclass -{i386,x86_64}-cpu. Reviewed-by: Eduardo Habkost Signed-off-by: Andreas F=C3=A4rber --- target-i386/cpu.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index eb1825b..b438478 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1751,6 +1751,7 @@ X86CPU *cpu_x86_create(const char *cpu_model, Devic= eState *icc_bridge, CPUX86State *env; gchar **model_pieces; char *name, *features; + char *typename; Error *error =3D NULL; =20 model_pieces =3D g_strsplit(cpu_model, ",", 2); @@ -1778,6 +1779,14 @@ X86CPU *cpu_x86_create(const char *cpu_model, Devi= ceState *icc_bridge, goto out; } =20 + /* Emulate per-model subclasses for global properties */ + typename =3D g_strdup_printf("%s-" TYPE_X86_CPU, name); + qdev_prop_set_globals_for_type(DEVICE(cpu), typename, &error); + g_free(typename); + if (error) { + goto out; + } + cpu_x86_parse_featurestr(cpu, features, &error); if (error) { goto out; --=20 1.8.1.4