diff options
author | Andreas Färber <afaerber@suse.de> | 2013-05-01 17:05:47 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-05-06 19:55:00 +0200 |
commit | ba2bc7a42e7c7b343f996967484ce3a1543cfebc (patch) | |
tree | 0b3e4d8f137b9d33ff9a48e059754ce47cce97cb /target-i386/cpu.c | |
parent | 868d378bb087c6003bfa0e431aec0e5871a90ff4 (diff) | |
download | qemu-ba2bc7a42e7c7b343f996967484ce3a1543cfebc.zip qemu-ba2bc7a42e7c7b343f996967484ce3a1543cfebc.tar.gz qemu-ba2bc7a42e7c7b343f996967484ce3a1543cfebc.tar.bz2 |
target-i386: Emulate X86CPU subclasses for global properties
After initializing the object from its x86_def_t and before setting any
additional -cpu arguments, set any global properties for the designated
subclass <name>-{i386,x86_64}-cpu.
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-i386/cpu.c')
-rw-r--r-- | target-i386/cpu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index eb1825b..b438478 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1751,6 +1751,7 @@ X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge, CPUX86State *env; gchar **model_pieces; char *name, *features; + char *typename; Error *error = NULL; model_pieces = g_strsplit(cpu_model, ",", 2); @@ -1778,6 +1779,14 @@ X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge, goto out; } + /* Emulate per-model subclasses for global properties */ + typename = g_strdup_printf("%s-" TYPE_X86_CPU, name); + qdev_prop_set_globals_for_type(DEVICE(cpu), typename, &error); + g_free(typename); + if (error) { + goto out; + } + cpu_x86_parse_featurestr(cpu, features, &error); if (error) { goto out; |