]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu_x86: Move and rename x86FormatSignatures
authorJiri Denemark <jdenemar@redhat.com>
Thu, 26 Mar 2020 14:14:41 +0000 (15:14 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Wed, 8 Apr 2020 15:42:17 +0000 (17:42 +0200)
Later in this series the function will work on a newly introduced
virCPUx86Signatures structure. Let's move it to the place where all
related functions will be added and rename the function as
virCPUx86SignaturesFormat for easier review of the virCPUx86Signatures
patch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/cpu/cpu_x86.c

index 407a5d54dec49589c9f60c5825eca3a0632193a3..b6ba26b0d0e4cf4d2f614a034e424829ee2b2c5d 100644 (file)
@@ -1125,6 +1125,23 @@ virCPUx86SignaturesMatch(virCPUx86ModelPtr model,
 }
 
 
+static char *
+virCPUx86SignaturesFormat(virCPUx86ModelPtr model)
+{
+    virBuffer buf = VIR_BUFFER_INITIALIZER;
+    size_t i;
+
+    for (i = 0; i < model->nsignatures; i++) {
+        virBufferAsprintf(&buf, "%06lx,",
+                          (unsigned long)model->signatures[i]);
+    }
+
+    virBufferTrim(&buf, ",");
+
+    return virBufferContentAndReset(&buf);
+}
+
+
 static void
 x86ModelFree(virCPUx86ModelPtr model)
 {
@@ -1890,23 +1907,6 @@ virCPUx86Compare(virCPUDefPtr host,
 }
 
 
-static char *
-x86FormatSignatures(virCPUx86ModelPtr model)
-{
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
-    size_t i;
-
-    for (i = 0; i < model->nsignatures; i++) {
-        virBufferAsprintf(&buf, "%06lx,",
-                          (unsigned long)model->signatures[i]);
-    }
-
-    virBufferTrim(&buf, ",");
-
-    return virBufferContentAndReset(&buf);
-}
-
-
 /*
  * Checks whether a candidate model is a better fit for the CPU data than the
  * current model.
@@ -2134,7 +2134,7 @@ x86Decode(virCPUDefPtr cpu,
     if (vendor)
         cpu->vendor = g_strdup(vendor->name);
 
-    sigs = x86FormatSignatures(model);
+    sigs = virCPUx86SignaturesFormat(model);
 
     VIR_DEBUG("Using CPU model %s (signatures %s) for CPU with signature %06lx",
               model->name, NULLSTR(sigs), (unsigned long)signature);