Blob Blame History Raw
From e0ea2a8c9fb17cbb0b48cb8a1548152e962b126b Mon Sep 17 00:00:00 2001
Message-Id: <e0ea2a8c9fb17cbb0b48cb8a1548152e962b126b@dist-git>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Fri, 21 Jun 2019 09:25:45 +0200
Subject: [PATCH] cpu_x86: Fix placement of *CheckFeature functions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Commit 0a97486e09 moved them outside #ifdef, but after virCPUx86GetHost,
which will start calling them in the following patch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
(cherry picked from commit 32f577ab10aefda6c4666abd07814c5c39f57788)

https://bugzilla.redhat.com/show_bug.cgi?id=1697627

Conflicts:
	src/cpu/cpu_x86.c
            - only the last patch moving these functions is backported

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Message-Id: <7bb25ee8ca5b743934fa2ae8249f5715a47aba06.1561068591.git.jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/cpu/cpu_x86.c | 70 +++++++++++++++++++++++------------------------
 1 file changed, 35 insertions(+), 35 deletions(-)

diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index fdc2974a0d..3c1bd623db 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -2377,6 +2377,41 @@ x86Encode(virArch arch,
 }
 
 
+static int
+virCPUx86CheckFeature(const virCPUDef *cpu,
+                      const char *name)
+{
+    int ret = -1;
+    virCPUx86MapPtr map;
+    virCPUx86ModelPtr model = NULL;
+
+    if (!(map = virCPUx86GetMap()))
+        return -1;
+
+    if (!(model = x86ModelFromCPU(cpu, map, -1)))
+        goto cleanup;
+
+    ret = x86FeatureInData(name, &model->data, map);
+
+ cleanup:
+    x86ModelFree(model);
+    return ret;
+}
+
+
+static int
+virCPUx86DataCheckFeature(const virCPUData *data,
+                          const char *name)
+{
+    virCPUx86MapPtr map;
+
+    if (!(map = virCPUx86GetMap()))
+        return -1;
+
+    return x86FeatureInData(name, &data->data.x86, map);
+}
+
+
 #if defined(__i386__) || defined(__x86_64__)
 static inline void
 cpuidCall(virCPUx86CPUID *cpuid)
@@ -2706,41 +2741,6 @@ cpuidSet(uint32_t base, virCPUDataPtr data)
 }
 
 
-static int
-virCPUx86CheckFeature(const virCPUDef *cpu,
-                      const char *name)
-{
-    int ret = -1;
-    virCPUx86MapPtr map;
-    virCPUx86ModelPtr model = NULL;
-
-    if (!(map = virCPUx86GetMap()))
-        return -1;
-
-    if (!(model = x86ModelFromCPU(cpu, map, -1)))
-        goto cleanup;
-
-    ret = x86FeatureInData(name, &model->data, map);
-
- cleanup:
-    x86ModelFree(model);
-    return ret;
-}
-
-
-static int
-virCPUx86DataCheckFeature(const virCPUData *data,
-                          const char *name)
-{
-    virCPUx86MapPtr map;
-
-    if (!(map = virCPUx86GetMap()))
-        return -1;
-
-    return x86FeatureInData(name, &data->data.x86, map);
-}
-
-
 static int
 virCPUx86GetHost(virCPUDefPtr cpu,
                  virDomainCapsCPUModelsPtr models)
-- 
2.22.0