render / rpms / libvirt

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