c480ed
From e0ea2a8c9fb17cbb0b48cb8a1548152e962b126b Mon Sep 17 00:00:00 2001
c480ed
Message-Id: <e0ea2a8c9fb17cbb0b48cb8a1548152e962b126b@dist-git>
c480ed
From: Jiri Denemark <jdenemar@redhat.com>
c480ed
Date: Fri, 21 Jun 2019 09:25:45 +0200
c480ed
Subject: [PATCH] cpu_x86: Fix placement of *CheckFeature functions
c480ed
MIME-Version: 1.0
c480ed
Content-Type: text/plain; charset=UTF-8
c480ed
Content-Transfer-Encoding: 8bit
c480ed
c480ed
Commit 0a97486e09 moved them outside #ifdef, but after virCPUx86GetHost,
c480ed
which will start calling them in the following patch.
c480ed
c480ed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c480ed
(cherry picked from commit 32f577ab10aefda6c4666abd07814c5c39f57788)
c480ed
c480ed
https://bugzilla.redhat.com/show_bug.cgi?id=1697627
c480ed
c480ed
Conflicts:
c480ed
	src/cpu/cpu_x86.c
c480ed
            - only the last patch moving these functions is backported
c480ed
c480ed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c480ed
Message-Id: <7bb25ee8ca5b743934fa2ae8249f5715a47aba06.1561068591.git.jdenemar@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
---
c480ed
 src/cpu/cpu_x86.c | 70 +++++++++++++++++++++++------------------------
c480ed
 1 file changed, 35 insertions(+), 35 deletions(-)
c480ed
c480ed
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
c480ed
index fdc2974a0d..3c1bd623db 100644
c480ed
--- a/src/cpu/cpu_x86.c
c480ed
+++ b/src/cpu/cpu_x86.c
c480ed
@@ -2377,6 +2377,41 @@ x86Encode(virArch arch,
c480ed
 }
c480ed
 
c480ed
 
c480ed
+static int
c480ed
+virCPUx86CheckFeature(const virCPUDef *cpu,
c480ed
+                      const char *name)
c480ed
+{
c480ed
+    int ret = -1;
c480ed
+    virCPUx86MapPtr map;
c480ed
+    virCPUx86ModelPtr model = NULL;
c480ed
+
c480ed
+    if (!(map = virCPUx86GetMap()))
c480ed
+        return -1;
c480ed
+
c480ed
+    if (!(model = x86ModelFromCPU(cpu, map, -1)))
c480ed
+        goto cleanup;
c480ed
+
c480ed
+    ret = x86FeatureInData(name, &model->data, map);
c480ed
+
c480ed
+ cleanup:
c480ed
+    x86ModelFree(model);
c480ed
+    return ret;
c480ed
+}
c480ed
+
c480ed
+
c480ed
+static int
c480ed
+virCPUx86DataCheckFeature(const virCPUData *data,
c480ed
+                          const char *name)
c480ed
+{
c480ed
+    virCPUx86MapPtr map;
c480ed
+
c480ed
+    if (!(map = virCPUx86GetMap()))
c480ed
+        return -1;
c480ed
+
c480ed
+    return x86FeatureInData(name, &data->data.x86, map);
c480ed
+}
c480ed
+
c480ed
+
c480ed
 #if defined(__i386__) || defined(__x86_64__)
c480ed
 static inline void
c480ed
 cpuidCall(virCPUx86CPUID *cpuid)
c480ed
@@ -2706,41 +2741,6 @@ cpuidSet(uint32_t base, virCPUDataPtr data)
c480ed
 }
c480ed
 
c480ed
 
c480ed
-static int
c480ed
-virCPUx86CheckFeature(const virCPUDef *cpu,
c480ed
-                      const char *name)
c480ed
-{
c480ed
-    int ret = -1;
c480ed
-    virCPUx86MapPtr map;
c480ed
-    virCPUx86ModelPtr model = NULL;
c480ed
-
c480ed
-    if (!(map = virCPUx86GetMap()))
c480ed
-        return -1;
c480ed
-
c480ed
-    if (!(model = x86ModelFromCPU(cpu, map, -1)))
c480ed
-        goto cleanup;
c480ed
-
c480ed
-    ret = x86FeatureInData(name, &model->data, map);
c480ed
-
c480ed
- cleanup:
c480ed
-    x86ModelFree(model);
c480ed
-    return ret;
c480ed
-}
c480ed
-
c480ed
-
c480ed
-static int
c480ed
-virCPUx86DataCheckFeature(const virCPUData *data,
c480ed
-                          const char *name)
c480ed
-{
c480ed
-    virCPUx86MapPtr map;
c480ed
-
c480ed
-    if (!(map = virCPUx86GetMap()))
c480ed
-        return -1;
c480ed
-
c480ed
-    return x86FeatureInData(name, &data->data.x86, map);
c480ed
-}
c480ed
-
c480ed
-
c480ed
 static int
c480ed
 virCPUx86GetHost(virCPUDefPtr cpu,
c480ed
                  virDomainCapsCPUModelsPtr models)
c480ed
-- 
c480ed
2.22.0
c480ed