From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvSnT-0006Eu-LX for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:12:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvSnS-0005Pf-Fu for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:12:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45654) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvSnS-0005PU-6z for qemu-devel@nongnu.org; Wed, 16 Jan 2013 08:12:50 -0500 Date: Wed, 16 Jan 2013 14:12:47 +0100 From: Igor Mammedov Message-ID: <20130116141247.330112ed@nial.usersys.redhat.com> In-Reply-To: <1358314380-9400-4-git-send-email-afaerber@suse.de> References: <1358314380-9400-1-git-send-email-afaerber@suse.de> <1358314380-9400-4-git-send-email-afaerber@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC qom-cpu 03/15] target-i386: Update CPU to QOM realizefn List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?ISO-8859-1?B?RuRyYmVy?= Cc: qemu-devel@nongnu.org, Eduardo Habkost On Wed, 16 Jan 2013 06:32:48 +0100 Andreas F=E4rber wrote: > Adapt the signature of x86_cpu_realize(), hook up to > DeviceClass::realize and set realized =3D true in cpu_x86_init(). >=20 > Signed-off-by: Andreas F=E4rber > Cc: Eduardo Habkost > Cc: Igor Mammedov Reviewed-By: Igor Mammedov > --- > target-i386/cpu-qom.h | 3 --- > target-i386/cpu.c | 7 +++++-- > target-i386/helper.c | 2 +- > 3 Dateien ge=E4ndert, 6 Zeilen hinzugef=FCgt(+), 6 Zeilen entfernt(-) >=20 > diff --git a/target-i386/cpu-qom.h b/target-i386/cpu-qom.h > index 332916a..3478dc9 100644 > --- a/target-i386/cpu-qom.h > +++ b/target-i386/cpu-qom.h > @@ -72,8 +72,5 @@ static inline X86CPU *x86_env_get_cpu(CPUX86State *env) > =20 > #define ENV_GET_CPU(e) CPU(x86_env_get_cpu(e)) > =20 > -/* TODO Drop once ObjectClass::realize is available */ > -void x86_cpu_realize(Object *obj, Error **errp); > - > =20 > #endif > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index 333745b..640dcdb 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@ -2140,9 +2140,9 @@ static void x86_cpu_apic_init(X86CPU *cpu, Error > **errp) } > #endif > =20 > -void x86_cpu_realize(Object *obj, Error **errp) > +static void x86_cpu_realizefn(DeviceState *dev, Error **errp) > { > - X86CPU *cpu =3D X86_CPU(obj); > + X86CPU *cpu =3D X86_CPU(dev); > CPUX86State *env =3D &cpu->env; > =20 > if (env->cpuid_7_0_ebx_features && env->cpuid_level < 7) { > @@ -2247,6 +2247,9 @@ static void x86_cpu_common_class_init(ObjectClass > *oc, void *data) { > X86CPUClass *xcc =3D X86_CPU_CLASS(oc); > CPUClass *cc =3D CPU_CLASS(oc); > + DeviceClass *dc =3D DEVICE_CLASS(oc); > + > + dc->realize =3D x86_cpu_realizefn; > =20 > xcc->parent_reset =3D cc->reset; > cc->reset =3D x86_cpu_reset; > diff --git a/target-i386/helper.c b/target-i386/helper.c > index 547c25e..bf43d6a 100644 > --- a/target-i386/helper.c > +++ b/target-i386/helper.c > @@ -1280,7 +1280,7 @@ X86CPU *cpu_x86_init(const char *cpu_model) > return NULL; > } > =20 > - x86_cpu_realize(OBJECT(cpu), &error); > + object_property_set_bool(OBJECT(cpu), true, "realized", &error); > if (error) { > error_free(error); > object_delete(OBJECT(cpu));