]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu_x86: Fix placement of *CheckFeature functions
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 14 Apr 2019 19:44:01 +0000 (21:44 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Apr 2019 07:48:05 +0000 (09:48 +0200)
In e17d10386 these functions were mistakenly moved into an #ifdef
block, but remained used outside of it leaving the build broken
for platforms where #ifdef evaluated to false.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
src/cpu/cpu_x86.c

index 1fe6770d575766324fe47f0ac88eb41daa9bbdb5..f05bfa24e0ffd0cdd65f3b4c081a57a6a8fffb50 100644 (file)
@@ -2707,6 +2707,35 @@ cpuidSet(uint32_t base, virCPUDataPtr data)
 }
 
 
+
+
+static int
+virCPUx86GetHost(virCPUDefPtr cpu,
+                 virDomainCapsCPUModelsPtr models)
+{
+    virCPUDataPtr cpuData = NULL;
+    int ret = -1;
+
+    if (virCPUx86DriverInitialize() < 0)
+        goto cleanup;
+
+    if (!(cpuData = virCPUDataNew(archs[0])))
+        goto cleanup;
+
+    if (cpuidSet(CPUX86_BASIC, cpuData) < 0 ||
+        cpuidSet(CPUX86_EXTENDED, cpuData) < 0)
+        goto cleanup;
+
+    ret = x86DecodeCPUData(cpu, cpuData, models);
+    cpu->microcodeVersion = virHostCPUGetMicrocodeVersion();
+
+ cleanup:
+    virCPUx86DataFree(cpuData);
+    return ret;
+}
+#endif
+
+
 static int
 virCPUx86CheckFeature(const virCPUDef *cpu,
                       const char *name)
@@ -2742,33 +2771,6 @@ virCPUx86DataCheckFeature(const virCPUData *data,
 }
 
 
-static int
-virCPUx86GetHost(virCPUDefPtr cpu,
-                 virDomainCapsCPUModelsPtr models)
-{
-    virCPUDataPtr cpuData = NULL;
-    int ret = -1;
-
-    if (virCPUx86DriverInitialize() < 0)
-        goto cleanup;
-
-    if (!(cpuData = virCPUDataNew(archs[0])))
-        goto cleanup;
-
-    if (cpuidSet(CPUX86_BASIC, cpuData) < 0 ||
-        cpuidSet(CPUX86_EXTENDED, cpuData) < 0)
-        goto cleanup;
-
-    ret = x86DecodeCPUData(cpu, cpuData, models);
-    cpu->microcodeVersion = virHostCPUGetMicrocodeVersion();
-
- cleanup:
-    virCPUx86DataFree(cpuData);
-    return ret;
-}
-#endif
-
-
 static virCPUDefPtr
 virCPUx86Baseline(virCPUDefPtr *cpus,
                   unsigned int ncpus,