Signed-off-by: Andrew Jones <drjo...@redhat.com> --- qom/cpu.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/qom/cpu.c b/qom/cpu.c index 751e992de8823..024cda3eb98c8 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -28,6 +28,7 @@ #include "exec/log.h" #include "qemu/error-report.h" #include "sysemu/sysemu.h" +#include "hw/qdev-properties.h" bool cpu_exists(int64_t id) { @@ -342,6 +343,12 @@ static int64_t cpu_common_get_arch_id(CPUState *cpu) return cpu->cpu_index; } +static Property cpu_common_properties[] = { + DEFINE_PROP_INT32("nr-cores", CPUState, nr_cores, 1), + DEFINE_PROP_INT32("nr-threads", CPUState, nr_threads, 1), + DEFINE_PROP_END_OF_LIST() +}; + static void cpu_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); @@ -367,6 +374,7 @@ static void cpu_class_init(ObjectClass *klass, void *data) k->cpu_exec_exit = cpu_common_noop; k->cpu_exec_interrupt = cpu_common_exec_interrupt; dc->realize = cpu_common_realizefn; + dc->props = cpu_common_properties; /* * Reason: CPUs still need special care by board code: wiring up * IRQs, adding reset handlers, halting non-first CPUs, ... -- 2.4.11