render / rpms / libvirt

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