From a07f953ef4ef48058c24fb50b49e6fa28bf5f5f4 Mon Sep 17 00:00:00 2001 From: Igor Mammedov Date: Mon, 25 Jul 2016 11:59:21 +0200 Subject: exec: Set cpu_index only if it's not been explictly set It keeps the legacy behavior for all users that doesn't care about stable cpu_index value, but would allow boards that would support device_add/device_del to set stable cpu_index that won't depend on order in which cpus are created/destroyed. While at that simplify cpu_get_free_index() as cpu_index generated by USER_ONLY and softmmu variants is the same since none of the users support cpu-remove so far, except of not yet released spapr/x86 device_add/delr, which will be altered by follow up patches to set stable cpu_index manually. Signed-off-by: Igor Mammedov Reviewed-by: David Gibson Signed-off-by: Eduardo Habkost --- include/qom/cpu.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/qom/cpu.h') diff --git a/include/qom/cpu.h b/include/qom/cpu.h index cbcd64c92b..ce0c406f27 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -883,4 +883,6 @@ extern const struct VMStateDescription vmstate_cpu_common; .offset = 0, \ } +#define UNASSIGNED_CPU_INDEX -1 + #endif -- cgit v1.2.3