On Fri, Jul 14, 2017 at 03:51:59PM +0200, Igor Mammedov wrote:
> Move cpu_model +-feat parsing into a separate file so that it
> could be reused later for parsing similar format of sparc target
>
> Signed-off-by: Igor Mammedov <[email protected]>
> ---
> CC: Riku Voipio <[email protected]>
> CC: Laurent Vivier <[email protected]>
> CC: Paolo Bonzini <[email protected]>
> CC: Richard Henderson <[email protected]>
> CC: Eduardo Habkost <[email protected]>
> ---
> include/qom/cpu.h | 6 ++
> default-configs/i386-bsd-user.mak | 1 +
> default-configs/i386-linux-user.mak | 1 +
> default-configs/i386-softmmu.mak | 1 +
> default-configs/x86_64-bsd-user.mak | 1 +
> default-configs/x86_64-linux-user.mak | 1 +
> default-configs/x86_64-softmmu.mak | 1 +
> target/i386/cpu.c | 124 ++-------------------------
> util/Makefile.objs | 1 +
> util/legacy_cpu_features_parser.c | 153
> ++++++++++++++++++++++++++++++++++
> 10 files changed, 172 insertions(+), 118 deletions(-)
> create mode 100644 util/legacy_cpu_features_parser.c
>
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index 7bfd50c..60aea03 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -1039,4 +1039,10 @@ extern const struct VMStateDescription
> vmstate_cpu_common;
>
> #define UNASSIGNED_CPU_INDEX -1
>
> +int cpu_legacy_apply_features(Object *obj, GList *features, bool enable,
> + Error **errp);
> +
> +void cpu_legacy_parse_featurestr(const char *typename, char *features,
> + GList **plus_features, GList
> **minus_features,
> + Error **errp);
plus_features and minus_features only exist because of a (now
fixed) bug in the handling of cpu->max_features, and we don't
need them anymore, see the comment at x86_cpu_expand_features():
/*TODO: Now cpu->max_features doesn't overwrite features
* set using QOM properties, and we can convert
* plus_features & minus_features to global properties
* inside x86_cpu_parse_featurestr() too.
*/
Let's remove them instead of exposing this unnecessary misfeature
on the generic API.
--
Eduardo