]> git.proxmox.com Git - mirror_qemu.git/commit - target/i386/cpu.c
target-i386: Set custom features/properties without intermediate x86_def_t
authorIgor Mammedov <imammedo@redhat.com>
Mon, 21 Jan 2013 14:06:38 +0000 (15:06 +0100)
committerAndreas Färber <afaerber@suse.de>
Sun, 27 Jan 2013 13:34:27 +0000 (14:34 +0100)
commita91987c25db38834091174681a6e1ffcbe582182
treeb3af0e6ad2b5ddc186ba5688e2b809a624e45876
parent11acfdd5a1647895ff9094e7f93f3317224eb4d8
target-i386: Set custom features/properties without intermediate x86_def_t

Move custom features parsing after built-in cpu_model defaults are set
and set custom features directly on CPU instance. That allows to make a
clear distinction between built-in cpu model defaults that eventually
should go into class_init() and extra property setting which is done
after defaults are set on CPU instance.

Impl. details:
 * use object_property_parse() property setter so it would be a mechanical
   change to switch to global properties later.
 * And after all current features/properties are converted into static
   properties, it will take a trivial patch to switch to global properties.
   Which will allow to:
   * get CPU instance initialized with all parameters passed on -cpu ...
     cmd. line from object_new() call.
   * call cpu_model/featurestr parsing only once before CPUs are created
   * open a road for removing CPUxxxState.cpu_model_str field, when other
     CPUs are similarly converted to subclasses and static properties.
 - re-factor error handling, to use Error instead of fprintf()s, since
   it is anyway passed in for property setter.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386/cpu.c