render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
c480ed
From dec2ce4345db0d13cff8c639c69afbf894ee593a Mon Sep 17 00:00:00 2001
c480ed
Message-Id: <dec2ce4345db0d13cff8c639c69afbf894ee593a@dist-git>
c480ed
From: Jiri Denemark <jdenemar@redhat.com>
c480ed
Date: Fri, 21 Jun 2019 09:25:40 +0200
c480ed
Subject: [PATCH] cpu_x86: Move *CheckFeature functions
c480ed
MIME-Version: 1.0
c480ed
Content-Type: text/plain; charset=UTF-8
c480ed
Content-Transfer-Encoding: 8bit
c480ed
c480ed
They are static and we will need to call them a little bit closer to the
c480ed
beginning of the file.
c480ed
c480ed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
(cherry picked from commit e17d10386bd9abcfb37c7d8b151bbd1071a87fc4)
c480ed
c480ed
https://bugzilla.redhat.com/show_bug.cgi?id=1697627
c480ed
c480ed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c480ed
Message-Id: <41d2a36757ed83f70c9dc23e9b984e109e5a81ba.1561068591.git.jdenemar@redhat.com>
c480ed
Reviewed-by: Ján Tomko <jtomko@redhat.com>
c480ed
---
c480ed
 src/cpu/cpu_x86.c | 69 ++++++++++++++++++++++++-----------------------
c480ed
 1 file changed, 35 insertions(+), 34 deletions(-)
c480ed
c480ed
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
c480ed
index 49562944c1..fdc2974a0d 100644
c480ed
--- a/src/cpu/cpu_x86.c
c480ed
+++ b/src/cpu/cpu_x86.c
c480ed
@@ -2706,6 +2706,41 @@ 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
@@ -3062,40 +3097,6 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
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
 static int
c480ed
 virCPUx86GetModels(char ***models)
c480ed
 {
c480ed
-- 
c480ed
2.22.0
c480ed