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