thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
218e99
From 72dbf6a170042cdeccc37ef106df264a48631d71 Mon Sep 17 00:00:00 2001
218e99
From: Eduardo Habkost <ehabkost@redhat.com>
218e99
Date: Fri, 2 Aug 2013 14:08:51 +0200
218e99
Subject: target-i386: Pass X86CPU object to cpu_x86_find_by_name()
218e99
218e99
RH-Author: Eduardo Habkost <ehabkost@redhat.com>
218e99
Message-id: <1375452533-12507-2-git-send-email-ehabkost@redhat.com>
218e99
Patchwork-id: 52932
218e99
O-Subject: [RHEL-7 PATCH 1/3] target-i386: Pass X86CPU object to cpu_x86_find_by_name()
218e99
Bugzilla: 853101
218e99
RH-Acked-by: Bandan Das <bsd@redhat.com>
218e99
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
218e99
RH-Acked-by: Gleb Natapov <gleb@redhat.com>
218e99
218e99
Bugzilla: 853101
218e99
218e99
This will help us change the initialization code to not require carrying
218e99
some intermediate values in a x86_def_t struct (and eventually kill the
218e99
x86_def_t struct entirely).
218e99
218e99
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
218e99
Signed-off-by: Andreas Färber <afaerber@suse.de>
218e99
(cherry picked from commit c139911261c5acc9dae56b1180db320ba25636bd)
218e99
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
218e99
218e99
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
218e99
index 4b2da0d..0c9a99a 100644
218e99
--- a/target-i386/cpu.c
218e99
+++ b/target-i386/cpu.c
218e99
@@ -1475,7 +1475,8 @@ static void x86_cpu_get_feature_words(Object *obj, Visitor *v, void *opaque,
218e99
     error_propagate(errp, err);
218e99
 }
218e99
 
218e99
-static int cpu_x86_find_by_name(x86_def_t *x86_cpu_def, const char *name)
218e99
+static int cpu_x86_find_by_name(X86CPU *cpu, x86_def_t *x86_cpu_def,
218e99
+                                const char *name)
218e99
 {
218e99
     x86_def_t *def;
218e99
     int i;
218e99
@@ -1742,7 +1743,7 @@ static void cpu_x86_register(X86CPU *cpu, const char *name, Error **errp)
218e99
 
218e99
     memset(def, 0, sizeof(*def));
218e99
 
218e99
-    if (cpu_x86_find_by_name(def, name) < 0) {
218e99
+    if (cpu_x86_find_by_name(cpu, def, name) < 0) {
218e99
         error_setg(errp, "Unable to find CPU definition: %s", name);
218e99
         return;
218e99
     }