From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, aliguori@us.ibm.com,
wei.liu2@citrix.com, ehabkost@redhat.com,
stefano.stabellini@eu.citrix.com, sw@weilnetz.de,
mtosatti@redhat.com, agraf@suse.de, blauwirbel@gmail.com,
avi@redhat.com, jan.kiszka@siemens.com,
anthony.perard@citrix.com, pbonzini@redhat.com, afaerber@suse.de
Subject: [Qemu-devel] [PATCH qom-next 6/6] target-i386: move reset callback to cpu.c
Date: Wed, 23 May 2012 18:39:41 +0200 [thread overview]
Message-ID: <1337791181-27446-7-git-send-email-imammedo@redhat.com> (raw)
In-Reply-To: <1337791181-27446-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.
v2:
- fix build for i386-linux-target
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
hw/pc.c | 7 -------
target-i386/cpu.c | 11 +++++++++++
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/hw/pc.c b/hw/pc.c
index d7845ea..868dbe7 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -885,12 +885,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;
@@ -901,7 +895,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 99ef891..ad39f71 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1775,6 +1775,13 @@ static void x86_set_cpu_model(Object *obj, const char *value, Error **errp)
}
#ifndef CONFIG_USER_ONLY
+/* 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 CPUDebugExcpHandler *prev_debug_excp_handler;
static void breakpoint_handler(CPUX86State *env)
@@ -1823,6 +1830,10 @@ void x86_cpu_realize(Object *obj, Error **errp)
mce_init(cpu);
qemu_init_vcpu(env);
+
+#ifndef CONFIG_USER_ONLY
+ qemu_register_reset(x86_cpu_machine_reset_cb, cpu);
+#endif
cpu_reset(CPU(cpu));
}
--
1.7.7.6
prev parent reply other threads:[~2012-05-23 16:40 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-23 16:39 [Qemu-devel] [PATCH qom-next v2 0/6] target-i386: re-factor CPU creation/initialization to QOM Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 1/6] pc: Enable MSI support at APIC level Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 2/6] target-i386: move cpu halted decision into x86_cpu_reset Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 3/6] target-i386: add cpu-model property to x86_cpu Igor Mammedov
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 4/6] pc: move apic_mapped initialization into common apic init code Igor Mammedov
2012-05-23 16:44 ` Peter Maydell
2012-05-23 20:08 ` Jan Kiszka
2012-05-23 21:09 ` Igor Mammedov
2012-05-23 21:26 ` Peter Maydell
2012-05-24 13:10 ` Igor Mammedov
2012-05-24 13:21 ` Peter Maydell
2012-05-24 13:25 ` Jan Kiszka
2012-05-24 13:39 ` Igor Mammedov
2012-05-24 13:45 ` Andreas Färber
2012-05-23 16:39 ` [Qemu-devel] [PATCH qom-next 5/6] target-i386: make initialize CPU in QOM way Igor Mammedov
2012-05-23 21:27 ` Andreas Färber
2012-05-24 9:29 ` Igor Mammedov
2012-05-23 16:39 ` 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=1337791181-27446-7-git-send-email-imammedo@redhat.com \
--to=imammedo@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=anthony.perard@citrix.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=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=sw@weilnetz.de \
--cc=wei.liu2@citrix.com \
/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).