target-i386: Move cpu_x86_init()

Consolidate CPU functions in cpu.c.
Allows to make cpu_x86_register() static.

No functional changes.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Split command line parsing out of cpu_x86_register()

In order to instantiate a CPU subtype we will need to know which type,
so move the cpu_model splitting into cpu_x86_init().

Parameters need to be set on the X86CPU instance, so move
cpu_x86_parse_featurestr() into cpu_x86_init() as well.

This leaves cpu_x86_register() operating on the model name only.

Signed-off-by: Andreas Färber <afaerber@suse.de>
target-i386: Slim conversion to X86CPU subclasses

Move x86_def_t definition to header and embed into X86CPUClass.
Register types per built-in model definition.

Move version initialization from x86_cpudef_setup() to class_init.

Inline cpu_x86_register() into the X86CPU initfn.
Since instance_init cannot reports errors, drop error handling.

Replace cpu_x86_find_by_name() with x86_cpu_class_by_name().
Move KVM host vendor override from cpu_x86_find_by_name() to the initfn.

Register host-{i386,x86_64}-cpu type from KVM code to avoid #ifdefs.
Make kvm_cpu_fill_host() a class_init and inline cpu_x86_fill_model_id().

Let kvm_check_features_against_host() obtain host-{i386,86_64}-cpu for
comparison.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Remove cpudef_setup() hooks

QOM (and KVM) infrastructure have obsoleted x86_cpudef_setup().
Drop the conditional callers that are now unused.

Signed-off-by: Andreas Färber <afaerber@suse.de>