aboutsummaryrefslogtreecommitdiff
path: root/qom/cpu.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2012-12-05 14:49:13 -0200
committerAndreas Färber <afaerber@suse.de>2013-01-08 21:03:44 +0100
commit961f839570f01d60a0b224248e6e56fc1d675793 (patch)
treee05518306d7e5b792556518a32b7e57251fa3004 /qom/cpu.c
parent5d5b24d042072fb4d13e7027f6e52e44390a9896 (diff)
cpu: Change parent type to Device
This finally makes the CPU class a subclass of the Device class, allowing us to start using DeviceState properties on CPU subclasses. It has no_user=1, as creating CPUs using -device doesn't work yet. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'qom/cpu.c')
-rw-r--r--qom/cpu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/qom/cpu.c b/qom/cpu.c
index d4d436f80a..49e5134ea1 100644
--- a/qom/cpu.c
+++ b/qom/cpu.c
@@ -36,14 +36,16 @@ static void cpu_common_reset(CPUState *cpu)
static void cpu_class_init(ObjectClass *klass, void *data)
{
+ DeviceClass *dc = DEVICE_CLASS(klass);
CPUClass *k = CPU_CLASS(klass);
k->reset = cpu_common_reset;
+ dc->no_user = 1;
}
-static TypeInfo cpu_type_info = {
+static const TypeInfo cpu_type_info = {
.name = TYPE_CPU,
- .parent = TYPE_OBJECT,
+ .parent = TYPE_DEVICE,
.instance_size = sizeof(CPUState),
.abstract = true,
.class_size = sizeof(CPUClass),