qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, ehabkost@redhat.com, sw@weilnetz.de,
	mtosatti@redhat.com, blauwirbel@gmail.com, avi@redhat.com,
	jan.kiszka@siemens.com, pbonzini@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH qom-next 5/5] target-i386: move reset callback to cpu.c
Date: Tue, 22 May 2012 12:35:54 +0200	[thread overview]
Message-ID: <1337682954-20618-6-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1337682954-20618-1-git-send-email-imammedo@redhat.com>

Moving reset callback into cpu object from board level will allow
properly create object during run-time (hotplug).

When reset over QOM hierarchy is implemented, this reset callback
should be removed.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
 hw/pc.c           |    7 -------
 target-i386/cpu.c |    8 ++++++++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 677f9e0..70dd0e6 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -888,12 +888,6 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level)
     }
 }
 
-static void pc_cpu_reset(void *opaque)
-{
-    X86CPU *cpu = opaque;
-    cpu_reset(CPU(cpu));
-}
-
 void pc_cpus_init(const char *cpu_model)
 {
     X86CPU *cpu;
@@ -904,7 +898,6 @@ void pc_cpus_init(const char *cpu_model)
         if (cpu == NULL) {
             exit(1);
         }
-        qemu_register_reset(pc_cpu_reset, cpu);
     }
 }
 
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 0e804ea..87f4f5a 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1716,6 +1716,13 @@ static void x86_cpu_reset(CPUState *s)
     env->halted = !(cpu_get_apic_base(env->apic_state) & MSR_IA32_APICBASE_BSP);
 }
 
+/* TODO: remove me, when reset over QOM tree is implemented */
+static void x86_cpu_machine_reset_cb(void *opaque)
+{
+    X86CPU *cpu = opaque;
+    cpu_reset(CPU(cpu));
+}
+
 static void mce_init(X86CPU *cpu)
 {
     CPUX86State *cenv = &cpu->env;
@@ -1812,6 +1819,7 @@ void x86_cpu_realize(Object *obj, Error **errp)
 
     mce_init(cpu);
     qemu_init_vcpu(env);
+    qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
     cpu_reset(CPU(cpu));
 }
 
-- 
1.7.7.6

      parent reply	other threads:[~2012-05-22 10:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22 10:35 [Qemu-devel] [PATCH qom-next 0/5] target-i386: re-factor CPU creation/initialization to QOM Igor Mammedov
2012-05-22 10:35 ` [Qemu-devel] [PATCH qom-next 1/5] target-i386: move cpu halted decision into x86_cpu_reset Igor Mammedov
2012-05-22 10:59   ` Peter Maydell
2012-05-22 12:34     ` Igor Mammedov
2012-05-22 10:35 ` [Qemu-devel] [PATCH qom-next 2/5] target-i386: add cpu-model property to x86_cpu Igor Mammedov
2012-05-22 10:35 ` [Qemu-devel] [PATCH qom-next 3/5] pc: move apic_mapped initialization into common apic init code Igor Mammedov
2012-05-22 10:48   ` Jan Kiszka
2012-05-22 12:42     ` Igor Mammedov
2012-05-22 14:24       ` Andreas Färber
2012-05-22 14:35         ` Jan Kiszka
2012-05-22 15:47         ` Paolo Bonzini
2012-05-23  9:17         ` Igor Mammedov
2012-05-22 10:51   ` Jan Kiszka
2012-05-22 10:35 ` [Qemu-devel] [PATCH qom-next 4/5] target-i386: make initialize CPU in QOM way Igor Mammedov
2012-05-22 10:56   ` Jan Kiszka
2012-05-22 12:47     ` Igor Mammedov
2012-05-22 10:35 ` Igor Mammedov [this message]

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=1337682954-20618-6-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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).