cpu_x86_find_by_name() will go away when we move to CPU model classes. Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- target-i386/cpu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 2e24e00..9209bb1 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1402,11 +1402,6 @@ static int cpu_x86_find_by_name(X86CPU *cpu, X86CPUDefinition *x86_cpu_def, { X86CPUModelTableEntry *def; - if (!cpu_model) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cpu_model", "NULL"); - return -1; - } - for (def = x86_defs; def; def = def->next) { if (!strcmp(cpu_model, def->name)) { break; @@ -1521,6 +1516,11 @@ X86CPU *cpu_x86_create(const char *cpu_model) env = &cpu->env; env->cpu_model_str = cpu_model; + if (!cpu_model) { + error_set(&error, QERR_INVALID_PARAMETER_VALUE, "cpu_model", "NULL"); + goto error; + } + if (cpu_x86_find_by_name(cpu, def, name, &error) < 0) { goto error; } -- 1.7.11.2