render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
b971b8
From 33cac9bcf27a885febf12e094cb2579f16a421b6 Mon Sep 17 00:00:00 2001
b971b8
Message-Id: <33cac9bcf27a885febf12e094cb2579f16a421b6@dist-git>
b971b8
From: Jiri Denemark <jdenemar@redhat.com>
b971b8
Date: Tue, 26 May 2020 10:59:27 +0200
b971b8
Subject: [PATCH] cpu_x86: Move and rename x86ModelCopySignatures
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 were all
b971b8
related functions will be added and rename the function as
b971b8
virCPUx86SignaturesCopy 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 a8ec1d746ed41ac76df2e28cbc5683b3e37b9a60)
b971b8
b971b8
https://bugzilla.redhat.com/show_bug.cgi?id=1840010
b971b8
b971b8
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
b971b8
Message-Id: <0d4f902805cd5534eadedd2ec61385e9798c8b40.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 b4b1b475d6..16e6aa73d2 100644
b971b8
--- a/src/cpu/cpu_x86.c
b971b8
+++ b/src/cpu/cpu_x86.c
b971b8
@@ -1090,23 +1090,9 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
b971b8
 }
b971b8
 
b971b8
 
b971b8
-static void
b971b8
-x86ModelFree(virCPUx86ModelPtr model)
b971b8
-{
b971b8
-    if (!model)
b971b8
-        return;
b971b8
-
b971b8
-    g_free(model->name);
b971b8
-    g_free(model->signatures);
b971b8
-    virCPUx86DataClear(&model->data);
b971b8
-    g_free(model);
b971b8
-}
b971b8
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree);
b971b8
-
b971b8
-
b971b8
 static int
b971b8
-x86ModelCopySignatures(virCPUx86ModelPtr dst,
b971b8
-                       virCPUx86ModelPtr src)
b971b8
+virCPUx86SignaturesCopy(virCPUx86ModelPtr dst,
b971b8
+                        virCPUx86ModelPtr src)
b971b8
 {
b971b8
     size_t i;
b971b8
 
b971b8
@@ -1124,6 +1110,20 @@ x86ModelCopySignatures(virCPUx86ModelPtr dst,
b971b8
 }
b971b8
 
b971b8
 
b971b8
+static void
b971b8
+x86ModelFree(virCPUx86ModelPtr model)
b971b8
+{
b971b8
+    if (!model)
b971b8
+        return;
b971b8
+
b971b8
+    g_free(model->name);
b971b8
+    g_free(model->signatures);
b971b8
+    virCPUx86DataClear(&model->data);
b971b8
+    g_free(model);
b971b8
+}
b971b8
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree);
b971b8
+
b971b8
+
b971b8
 static virCPUx86ModelPtr
b971b8
 x86ModelCopy(virCPUx86ModelPtr model)
b971b8
 {
b971b8
@@ -1132,7 +1132,7 @@ x86ModelCopy(virCPUx86ModelPtr model)
b971b8
     copy = g_new0(virCPUx86Model, 1);
b971b8
     copy->name = g_strdup(model->name);
b971b8
 
b971b8
-    if (x86ModelCopySignatures(copy, model) < 0) {
b971b8
+    if (virCPUx86SignaturesCopy(copy, model) < 0) {
b971b8
         x86ModelFree(copy);
b971b8
         return NULL;
b971b8
     }
b971b8
@@ -1360,7 +1360,7 @@ x86ModelParseAncestor(virCPUx86ModelPtr model,
b971b8
     }
b971b8
 
b971b8
     model->vendor = ancestor->vendor;
b971b8
-    if (x86ModelCopySignatures(model, ancestor) < 0)
b971b8
+    if (virCPUx86SignaturesCopy(model, ancestor) < 0)
b971b8
         return -1;
b971b8
 
b971b8
     x86DataCopy(&model->data, &ancestor->data);
b971b8
-- 
b971b8
2.26.2
b971b8