Blob Blame Raw
From 72dbf6a170042cdeccc37ef106df264a48631d71 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Fri, 2 Aug 2013 14:08:51 +0200
Subject: target-i386: Pass X86CPU object to cpu_x86_find_by_name()

RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <1375452533-12507-2-git-send-email-ehabkost@redhat.com>
Patchwork-id: 52932
O-Subject: [RHEL-7 PATCH 1/3] target-i386: Pass X86CPU object to cpu_x86_find_by_name()
Bugzilla: 853101
RH-Acked-by: Bandan Das <bsd@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
RH-Acked-by: Gleb Natapov <gleb@redhat.com>

Bugzilla: 853101

This will help us change the initialization code to not require carrying
some intermediate values in a x86_def_t struct (and eventually kill the
x86_def_t struct entirely).

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
(cherry picked from commit c139911261c5acc9dae56b1180db320ba25636bd)
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 4b2da0d..0c9a99a 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1475,7 +1475,8 @@ static void x86_cpu_get_feature_words(Object *obj, Visitor *v, void *opaque,
     error_propagate(errp, err);
 }
 
-static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *name)
+static int cpu_x86_find_by_name(X86CPU *cpu, x86_def_t *x86_cpu_def,
+                                const char *name)
 {
     x86_def_t *def;
     int i;
@@ -1742,7 +1743,7 @@ static void cpu_x86_register(X86CPU *cpu, const char *name, Error **errp)
 
     memset(def, 0, sizeof(*def));
 
-    if (cpu_x86_find_by_name(def, name) < 0) {
+    if (cpu_x86_find_by_name(cpu, def, name) < 0) {
         error_setg(errp, "Unable to find CPU definition: %s", name);
         return;
     }