c313de
From dec2ce4345db0d13cff8c639c69afbf894ee593a Mon Sep 17 00:00:00 2001
c313de
Message-Id: <dec2ce4345db0d13cff8c639c69afbf894ee593a@dist-git>
c313de
From: Jiri Denemark <jdenemar@redhat.com>
c313de
Date: Fri, 21 Jun 2019 09:25:40 +0200
c313de
Subject: [PATCH] cpu_x86: Move *CheckFeature functions
c313de
MIME-Version: 1.0
c313de
Content-Type: text/plain; charset=UTF-8
c313de
Content-Transfer-Encoding: 8bit
c313de
c313de
They are static and we will need to call them a little bit closer to the
c313de
beginning of the file.
c313de
c313de
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c313de
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c313de
(cherry picked from commit e17d10386bd9abcfb37c7d8b151bbd1071a87fc4)
c313de
c313de
https://bugzilla.redhat.com/show_bug.cgi?id=1697627
c313de
c313de
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c313de
Message-Id: <41d2a36757ed83f70c9dc23e9b984e109e5a81ba.1561068591.git.jdenemar@redhat.com>
c313de
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c313de
---
c313de
 src/cpu/cpu_x86.c | 69 ++++++++++++++++++++++++-----------------------
c313de
 1 file changed, 35 insertions(+), 34 deletions(-)
c313de
c313de
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
c313de
index 49562944c1..fdc2974a0d 100644
c313de
--- a/src/cpu/cpu_x86.c
c313de
+++ b/src/cpu/cpu_x86.c
c313de
@@ -2706,6 +2706,41 @@ cpuidSet(uint32_t base, virCPUDataPtr data)
c313de
 }
c313de
 
c313de
 
c313de
+static int
c313de
+virCPUx86CheckFeature(const virCPUDef *cpu,
c313de
+                      const char *name)
c313de
+{
c313de
+    int ret = -1;
c313de
+    virCPUx86MapPtr map;
c313de
+    virCPUx86ModelPtr model = NULL;
c313de
+
c313de
+    if (!(map = virCPUx86GetMap()))
c313de
+        return -1;
c313de
+
c313de
+    if (!(model = x86ModelFromCPU(cpu, map, -1)))
c313de
+        goto cleanup;
c313de
+
c313de
+    ret = x86FeatureInData(name, &model->data, map);
c313de
+
c313de
+ cleanup:
c313de
+    x86ModelFree(model);
c313de
+    return ret;
c313de
+}
c313de
+
c313de
+
c313de
+static int
c313de
+virCPUx86DataCheckFeature(const virCPUData *data,
c313de
+                          const char *name)
c313de
+{
c313de
+    virCPUx86MapPtr map;
c313de
+
c313de
+    if (!(map = virCPUx86GetMap()))
c313de
+        return -1;
c313de
+
c313de
+    return x86FeatureInData(name, &data->data.x86, map);
c313de
+}
c313de
+
c313de
+
c313de
 static int
c313de
 virCPUx86GetHost(virCPUDefPtr cpu,
c313de
                  virDomainCapsCPUModelsPtr models)
c313de
@@ -3062,40 +3097,6 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
c313de
 }
c313de
 
c313de
 
c313de
-static int
c313de
-virCPUx86CheckFeature(const virCPUDef *cpu,
c313de
-                      const char *name)
c313de
-{
c313de
-    int ret = -1;
c313de
-    virCPUx86MapPtr map;
c313de
-    virCPUx86ModelPtr model = NULL;
c313de
-
c313de
-    if (!(map = virCPUx86GetMap()))
c313de
-        return -1;
c313de
-
c313de
-    if (!(model = x86ModelFromCPU(cpu, map, -1)))
c313de
-        goto cleanup;
c313de
-
c313de
-    ret = x86FeatureInData(name, &model->data, map);
c313de
-
c313de
- cleanup:
c313de
-    x86ModelFree(model);
c313de
-    return ret;
c313de
-}
c313de
-
c313de
-
c313de
-static int
c313de
-virCPUx86DataCheckFeature(const virCPUData *data,
c313de
-                          const char *name)
c313de
-{
c313de
-    virCPUx86MapPtr map;
c313de
-
c313de
-    if (!(map = virCPUx86GetMap()))
c313de
-        return -1;
c313de
-
c313de
-    return x86FeatureInData(name, &data->data.x86, map);
c313de
-}
c313de
-
c313de
 static int
c313de
 virCPUx86GetModels(char ***models)
c313de
 {
c313de
-- 
c313de
2.22.0
c313de