render / rpms / libvirt

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