From 961f839570f01d60a0b224248e6e56fc1d675793 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 5 Dec 2012 14:49:13 -0200 Subject: cpu: Change parent type to Device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Eduardo Habkost Signed-off-by: Andreas Färber --- qom/cpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qom/cpu.c') diff --git a/qom/cpu.c b/qom/cpu.c index d4d436f..49e5134 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), -- cgit v1.1