0a7476
From fe175a3b2ab1176f26116e909a5014611c52339b Mon Sep 17 00:00:00 2001
0a7476
Message-Id: <fe175a3b2ab1176f26116e909a5014611c52339b@dist-git>
0a7476
From: Jiri Denemark <jdenemar@redhat.com>
0a7476
Date: Tue, 4 Jun 2019 13:04:31 +0200
0a7476
Subject: [PATCH] cpu_x86: Fix placement of *CheckFeature functions
0a7476
MIME-Version: 1.0
0a7476
Content-Type: text/plain; charset=UTF-8
0a7476
Content-Transfer-Encoding: 8bit
0a7476
0a7476
Commit 0a97486e09 moved them outside #ifdef, but after virCPUx86GetHost,
0a7476
which will start calling them in the following patch.
0a7476
0a7476
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
0a7476
(cherry picked from commit 32f577ab10aefda6c4666abd07814c5c39f57788)
0a7476
0a7476
https://bugzilla.redhat.com/show_bug.cgi?id=1641702
0a7476
0a7476
Conflicts:
0a7476
	src/cpu/cpu_x86.c
0a7476
            - only the last commit (from three upstream commits) moving
0a7476
              these functions was backported
0a7476
0a7476
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
0a7476
Message-Id: <60813074ba13f616ac2be224f4f800c98b169ec2.1559646067.git.jdenemar@redhat.com>
0a7476
Reviewed-by: Ján Tomko <jtomko@redhat.com>
0a7476
---
0a7476
 src/cpu/cpu_x86.c | 69 ++++++++++++++++++++++++-----------------------
0a7476
 1 file changed, 35 insertions(+), 34 deletions(-)
0a7476
0a7476
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
0a7476
index 1acd8c4f49..bd10862f57 100644
0a7476
--- a/src/cpu/cpu_x86.c
0a7476
+++ b/src/cpu/cpu_x86.c
0a7476
@@ -2212,6 +2212,41 @@ x86Encode(virArch arch,
0a7476
 }
0a7476
 
0a7476
 
0a7476
+static int
0a7476
+virCPUx86CheckFeature(const virCPUDef *cpu,
0a7476
+                      const char *name)
0a7476
+{
0a7476
+    int ret = -1;
0a7476
+    virCPUx86MapPtr map;
0a7476
+    virCPUx86ModelPtr model = NULL;
0a7476
+
0a7476
+    if (!(map = virCPUx86GetMap()))
0a7476
+        return -1;
0a7476
+
0a7476
+    if (!(model = x86ModelFromCPU(cpu, map, -1)))
0a7476
+        goto cleanup;
0a7476
+
0a7476
+    ret = x86FeatureInData(name, &model->data, map);
0a7476
+
0a7476
+ cleanup:
0a7476
+    x86ModelFree(model);
0a7476
+    return ret;
0a7476
+}
0a7476
+
0a7476
+
0a7476
+static int
0a7476
+virCPUx86DataCheckFeature(const virCPUData *data,
0a7476
+                          const char *name)
0a7476
+{
0a7476
+    virCPUx86MapPtr map;
0a7476
+
0a7476
+    if (!(map = virCPUx86GetMap()))
0a7476
+        return -1;
0a7476
+
0a7476
+    return x86FeatureInData(name, &data->data.x86, map);
0a7476
+}
0a7476
+
0a7476
+
0a7476
 #if defined(__i386__) || defined(__x86_64__)
0a7476
 static inline void
0a7476
 cpuidCall(virCPUx86CPUID *cpuid)
0a7476
@@ -2888,40 +2923,6 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
0a7476
 }
0a7476
 
0a7476
 
0a7476
-static int
0a7476
-virCPUx86CheckFeature(const virCPUDef *cpu,
0a7476
-                      const char *name)
0a7476
-{
0a7476
-    int ret = -1;
0a7476
-    virCPUx86MapPtr map;
0a7476
-    virCPUx86ModelPtr model = NULL;
0a7476
-
0a7476
-    if (!(map = virCPUx86GetMap()))
0a7476
-        return -1;
0a7476
-
0a7476
-    if (!(model = x86ModelFromCPU(cpu, map, -1)))
0a7476
-        goto cleanup;
0a7476
-
0a7476
-    ret = x86FeatureInData(name, &model->data, map);
0a7476
-
0a7476
- cleanup:
0a7476
-    x86ModelFree(model);
0a7476
-    return ret;
0a7476
-}
0a7476
-
0a7476
-
0a7476
-static int
0a7476
-virCPUx86DataCheckFeature(const virCPUData *data,
0a7476
-                          const char *name)
0a7476
-{
0a7476
-    virCPUx86MapPtr map;
0a7476
-
0a7476
-    if (!(map = virCPUx86GetMap()))
0a7476
-        return -1;
0a7476
-
0a7476
-    return x86FeatureInData(name, &data->data.x86, map);
0a7476
-}
0a7476
-
0a7476
 static int
0a7476
 virCPUx86GetModels(char ***models)
0a7476
 {
0a7476
-- 
0a7476
2.21.0
0a7476