From: Igor Mammedov <imammedo@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [Qemu-devel] [RFC qom-cpu 03/15] target-i386: Update CPU to QOM realizefn
Date: Wed, 16 Jan 2013 14:12:47 +0100 [thread overview]
Message-ID: <20130116141247.330112ed@nial.usersys.redhat.com> (raw)
In-Reply-To: <1358314380-9400-4-git-send-email-afaerber@suse.de>
On Wed, 16 Jan 2013 06:32:48 +0100
Andreas Färber <afaerber@suse.de> wrote:
> Adapt the signature of x86_cpu_realize(), hook up to
> DeviceClass::realize and set realized = true in cpu_x86_init().
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
Reviewed-By: Igor Mammedov <imammedo@redhat.com>
> ---
> target-i386/cpu-qom.h | 3 ---
> target-i386/cpu.c | 7 +++++--
> target-i386/helper.c | 2 +-
> 3 Dateien geändert, 6 Zeilen hinzugefügt(+), 6 Zeilen entfernt(-)
>
> 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)
>
> #define ENV_GET_CPU(e) CPU(x86_env_get_cpu(e))
>
> -/* TODO Drop once ObjectClass::realize is available */
> -void x86_cpu_realize(Object *obj, Error **errp);
> -
>
> #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
>
> -void x86_cpu_realize(Object *obj, Error **errp)
> +static void x86_cpu_realizefn(DeviceState *dev, Error **errp)
> {
> - X86CPU *cpu = X86_CPU(obj);
> + X86CPU *cpu = X86_CPU(dev);
> CPUX86State *env = &cpu->env;
>
> 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 = X86_CPU_CLASS(oc);
> CPUClass *cc = CPU_CLASS(oc);
> + DeviceClass *dc = DEVICE_CLASS(oc);
> +
> + dc->realize = x86_cpu_realizefn;
>
> xcc->parent_reset = cc->reset;
> cc->reset = 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;
> }
>
> - x86_cpu_realize(OBJECT(cpu), &error);
> + object_property_set_bool(OBJECT(cpu), true, "realized", &error);
> if (error) {
> error_free(error);
> object_delete(OBJECT(cpu));
next prev parent reply other threads:[~2013-01-16 13:12 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 5:32 [Qemu-devel] [RFC qom-cpu 00/15] CPUState QOM realizefn support Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 01/15] target-alpha: Update CPU to QOM realizefn Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 02/15] target-arm: " Andreas Färber
2013-01-16 15:52 ` Eduardo Habkost
2013-01-16 22:37 ` Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 03/15] target-i386: " Andreas Färber
2013-01-16 13:12 ` Igor Mammedov [this message]
2013-01-16 16:04 ` Eduardo Habkost
2013-01-16 22:52 ` Andreas Färber
2013-01-16 23:43 ` Eduardo Habkost
2013-01-17 8:03 ` Andreas Färber
2013-01-17 12:58 ` Eduardo Habkost
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 04/15] target-openrisc: " Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 05/15] target-ppc: " Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 06/15] target-cris: Introduce QOM realizefn for CRISCPU Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 07/15] target-lm32: Introduce QOM realizefn for LM32CPU Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 08/15] target-m68k: Introduce QOM realizefn for M68kCPU Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 09/15] target-microblaze: Introduce QOM realizefn for MicroBlazeCPU Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 10/15] target-mips: Introduce QOM realizefn for MIPSCPU Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 11/15] target-s390x: Introduce QOM realizefn for S390CPU Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 12/15] target-sh4: Introduce QOM realizefn for SuperHCPU Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 13/15] target-sparc: Introduce QOM realizefn for SPARCCPU Andreas Färber
2013-01-16 5:32 ` [Qemu-devel] [RFC qom-cpu 14/15] target-unicore32: Introduce QOM realizefn for UniCore32CPU Andreas Färber
2013-01-16 12:08 ` guanxuetao
2013-01-16 5:33 ` [Qemu-devel] [RFC qom-cpu 15/15] target-xtensa: Introduce QOM realizefn for XtensaCPU Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130116141247.330112ed@nial.usersys.redhat.com \
--to=imammedo@redhat.com \
--cc=afaerber@suse.de \
--cc=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).