On 10.06.2016 19:40, Andrew Jones wrote: > 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() > +};
Are you aware of the current CPU hotplug discussion that is going on? I'm not very involved there, but I think some of these reworks also move "nr_threads" into the CPU state already, e.g. see: https://github.com/dgibson/qemu/commit/9d07719784ecbeebea71 ... so you might want to check these patches first to see whether you can base your rework on them? Thomas