b971b8
From 2b76e3009c224c0d03a4d951e0686aad6f6dc577 Mon Sep 17 00:00:00 2001
b971b8
Message-Id: <2b76e3009c224c0d03a4d951e0686aad6f6dc577@dist-git>
b971b8
From: Jiri Denemark <jdenemar@redhat.com>
b971b8
Date: Tue, 26 May 2020 10:59:29 +0200
b971b8
Subject: [PATCH] cpu_x86: Move and rename x86FormatSignatures
b971b8
MIME-Version: 1.0
b971b8
Content-Type: text/plain; charset=UTF-8
b971b8
Content-Transfer-Encoding: 8bit
b971b8
b971b8
Later in this series the function will work on a newly introduced
b971b8
virCPUx86Signatures structure. Let's move it to the place where all
b971b8
related functions will be added and rename the function as
b971b8
virCPUx86SignaturesFormat for easier review of the virCPUx86Signatures
b971b8
patch.
b971b8
b971b8
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
b971b8
Reviewed-by: Ján Tomko <jtomko@redhat.com>
b971b8
(cherry picked from commit 7e0d351fa69c468906533b2ac9b24212df13a370)
b971b8
b971b8
https://bugzilla.redhat.com/show_bug.cgi?id=1840010
b971b8
b971b8
Conflicts:
b971b8
	src/cpu/cpu_x86.c
b971b8
            - v6.0.0-264-g0a125c7144 which removes the third argument
b971b8
              from virBufferTrim was not backported
b971b8
b971b8
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
b971b8
Message-Id: <fd16284339dd71e9f99b57bb7682014065e5d0ec.1590483392.git.jdenemar@redhat.com>
b971b8
Reviewed-by: Ján Tomko <jtomko@redhat.com>
b971b8
---
b971b8
 src/cpu/cpu_x86.c | 36 ++++++++++++++++++------------------
b971b8
 1 file changed, 18 insertions(+), 18 deletions(-)
b971b8
b971b8
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
b971b8
index 65a99876a9..9248403eff 100644
b971b8
--- a/src/cpu/cpu_x86.c
b971b8
+++ b/src/cpu/cpu_x86.c
b971b8
@@ -1125,6 +1125,23 @@ virCPUx86SignaturesMatch(virCPUx86ModelPtr model,
b971b8
 }
b971b8
 
b971b8
 
b971b8
+static char *
b971b8
+virCPUx86SignaturesFormat(virCPUx86ModelPtr model)
b971b8
+{
b971b8
+    virBuffer buf = VIR_BUFFER_INITIALIZER;
b971b8
+    size_t i;
b971b8
+
b971b8
+    for (i = 0; i < model->nsignatures; i++) {
b971b8
+        virBufferAsprintf(&buf, "%06lx,",
b971b8
+                          (unsigned long)model->signatures[i]);
b971b8
+    }
b971b8
+
b971b8
+    virBufferTrim(&buf, ",", -1);
b971b8
+
b971b8
+    return virBufferContentAndReset(&buf;;
b971b8
+}
b971b8
+
b971b8
+
b971b8
 static void
b971b8
 x86ModelFree(virCPUx86ModelPtr model)
b971b8
 {
b971b8
@@ -1890,23 +1907,6 @@ virCPUx86Compare(virCPUDefPtr host,
b971b8
 }
b971b8
 
b971b8
 
b971b8
-static char *
b971b8
-x86FormatSignatures(virCPUx86ModelPtr model)
b971b8
-{
b971b8
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
b971b8
-    size_t i;
b971b8
-
b971b8
-    for (i = 0; i < model->nsignatures; i++) {
b971b8
-        virBufferAsprintf(&buf, "%06lx,",
b971b8
-                          (unsigned long)model->signatures[i]);
b971b8
-    }
b971b8
-
b971b8
-    virBufferTrim(&buf, ",", -1);
b971b8
-
b971b8
-    return virBufferContentAndReset(&buf;;
b971b8
-}
b971b8
-
b971b8
-
b971b8
 /*
b971b8
  * Checks whether a candidate model is a better fit for the CPU data than the
b971b8
  * current model.
b971b8
@@ -2134,7 +2134,7 @@ x86Decode(virCPUDefPtr cpu,
b971b8
     if (vendor)
b971b8
         cpu->vendor = g_strdup(vendor->name);
b971b8
 
b971b8
-    sigs = x86FormatSignatures(model);
b971b8
+    sigs = virCPUx86SignaturesFormat(model);
b971b8
 
b971b8
     VIR_DEBUG("Using CPU model %s (signatures %s) for CPU with signature %06lx",
b971b8
               model->name, NULLSTR(sigs), (unsigned long)signature);
b971b8
-- 
b971b8
2.26.2
b971b8