From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwpFa-00073w-GP for qemu-devel@nongnu.org; Sun, 20 Jan 2013 02:23:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TwpFY-0006fc-Qf for qemu-devel@nongnu.org; Sun, 20 Jan 2013 02:23:30 -0500 Received: from cantor2.suse.de ([195.135.220.15]:45282 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TwpFY-0006fX-Kr for qemu-devel@nongnu.org; Sun, 20 Jan 2013 02:23:28 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 20 Jan 2013 08:22:47 +0100 Message-Id: <1358666571-1737-25-git-send-email-afaerber@suse.de> In-Reply-To: <1358666571-1737-1-git-send-email-afaerber@suse.de> References: <1358666571-1737-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] [RFC qom-cpu v2 24/28] target-s390x: Move TCG initialization to S390CPU initfn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexander Graf , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Richard Henderson Ensures that a QOM-created S390CPU is usable. Signed-off-by: Andreas F=C3=A4rber --- target-s390x/cpu.c | 6 ++++++ target-s390x/helper.c | 7 ------- 2 Dateien ge=C3=A4ndert, 6 Zeilen hinzugef=C3=BCgt(+), 7 Zeilen entfernt= (-) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index 60f71fc..109777e 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -112,6 +112,7 @@ static void s390_cpu_initfn(Object *obj) { S390CPU *cpu =3D S390_CPU(obj); CPUS390XState *env =3D &cpu->env; + static bool inited; static int cpu_num =3D 0; #if !defined(CONFIG_USER_ONLY) struct tm tm; @@ -133,6 +134,11 @@ static void s390_cpu_initfn(Object *obj) #endif env->cpu_num =3D cpu_num++; env->ext_index =3D -1; + + if (tcg_enabled() && !inited) { + inited =3D true; + s390x_translate_init(); + } } =20 static void s390_cpu_finalize(Object *obj) diff --git a/target-s390x/helper.c b/target-s390x/helper.c index 45020b2..bad0683 100644 --- a/target-s390x/helper.c +++ b/target-s390x/helper.c @@ -74,16 +74,9 @@ S390CPU *cpu_s390x_init(const char *cpu_model) { S390CPU *cpu; CPUS390XState *env; - static int inited; =20 cpu =3D S390_CPU(object_new(TYPE_S390_CPU)); env =3D &cpu->env; - - if (tcg_enabled() && !inited) { - inited =3D 1; - s390x_translate_init(); - } - env->cpu_model_str =3D cpu_model; =20 object_property_set_bool(OBJECT(cpu), true, "realized", NULL); --=20 1.7.10.4