summaryrefslogtreecommitdiff
path: root/include/qom/cpu.h
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2016-06-09 19:11:01 +0200
committerEduardo Habkost <ehabkost@redhat.com>2016-07-07 15:25:01 -0300
commit62a48a2a5798425997152dea3fc48708f9116c04 (patch)
treed07e143d87334112feb80a2422ccb5e7afdb65c7 /include/qom/cpu.h
parentcf2887c9738451eb989c6c102af070dee2dc172a (diff)
downloadqemu-62a48a2a5798425997152dea3fc48708f9116c04.zip
cpu: Use CPUClass->parse_features() as convertor to global properties
Currently CPUClass->parse_features() is used to parse -cpu features string and set properties on created CPU instances. But considering that features specified by -cpu apply to every created CPU instance, it doesn't make sense to parse the same features string for every CPU created. It also makes every target that cares about parsing features string explicitly call CPUClass->parse_features() parser, which gets in a way if we consider using generic device_add for CPU hotplug as device_add has not a clue about CPU specific hooks. Turns out we can use global properties mechanism to set properties on every created CPU instance for a given type. That way it's possible to convert CPU features into a set of global properties for CPU type specified by -cpu cpu_model and common Device.device_post_init() will apply them to CPU of given type automatically regardless whether it's manually created CPU or CPU created with help of device_add. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/qom/cpu.h')
-rw-r--r--include/qom/cpu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 32f3af3e1c..cacb100f7b 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -134,7 +134,7 @@ typedef struct CPUClass {
/*< public >*/
ObjectClass *(*class_by_name)(const char *cpu_model);
- void (*parse_features)(CPUState *cpu, char *str, Error **errp);
+ void (*parse_features)(const char *typename, char *str, Error **errp);
void (*reset)(CPUState *cpu);
int reset_dump_flags;