render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
b971b8
From 75afc6d9dc443666e1207ef6f1c968abdfec712a Mon Sep 17 00:00:00 2001
b971b8
Message-Id: <75afc6d9dc443666e1207ef6f1c968abdfec712a@dist-git>
b971b8
From: Jiri Denemark <jdenemar@redhat.com>
b971b8
Date: Tue, 26 May 2020 10:59:30 +0200
b971b8
Subject: [PATCH] cpu_x86: Introduce virCPUx86SignaturesFree
b971b8
MIME-Version: 1.0
b971b8
Content-Type: text/plain; charset=UTF-8
b971b8
Content-Transfer-Encoding: 8bit
b971b8
b971b8
The function will be used for freeing virCPUx86Signatures structure
b971b8
introduced later in this series.
b971b8
b971b8
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
b971b8
Reviewed-by: Ján Tomko <jtomko@redhat.com>
b971b8
(cherry picked from commit 372b2cf1ca3f4361546732a3f5f9c0c0be2591e9)
b971b8
b971b8
https://bugzilla.redhat.com/show_bug.cgi?id=1840010
b971b8
b971b8
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
b971b8
Message-Id: <163ef39d14ce5457272e7508172f64d58d22a56b.1590483392.git.jdenemar@redhat.com>
b971b8
Reviewed-by: Ján Tomko <jtomko@redhat.com>
b971b8
---
b971b8
 src/cpu/cpu_x86.c | 11 +++++++++--
b971b8
 1 file changed, 9 insertions(+), 2 deletions(-)
b971b8
b971b8
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
b971b8
index 9248403eff..ed2090b0c6 100644
b971b8
--- a/src/cpu/cpu_x86.c
b971b8
+++ b/src/cpu/cpu_x86.c
b971b8
@@ -1090,6 +1090,13 @@ x86FeatureParse(xmlXPathContextPtr ctxt,
b971b8
 }
b971b8
 
b971b8
 
b971b8
+static void
b971b8
+virCPUx86SignaturesFree(uint32_t *signatures)
b971b8
+{
b971b8
+    g_free(signatures);
b971b8
+}
b971b8
+
b971b8
+
b971b8
 static int
b971b8
 virCPUx86SignaturesCopy(virCPUx86ModelPtr dst,
b971b8
                         virCPUx86ModelPtr src)
b971b8
@@ -1149,7 +1156,7 @@ x86ModelFree(virCPUx86ModelPtr model)
b971b8
         return;
b971b8
 
b971b8
     g_free(model->name);
b971b8
-    g_free(model->signatures);
b971b8
+    virCPUx86SignaturesFree(model->signatures);
b971b8
     virCPUx86DataClear(&model->data);
b971b8
     g_free(model);
b971b8
 }
b971b8
@@ -1414,7 +1421,7 @@ x86ModelParseSignatures(virCPUx86ModelPtr model,
b971b8
         return n;
b971b8
 
b971b8
     /* Remove inherited signatures. */
b971b8
-    VIR_FREE(model->signatures);
b971b8
+    virCPUx86SignaturesFree(model->signatures);
b971b8
 
b971b8
     model->nsignatures = n;
b971b8
     if (VIR_ALLOC_N(model->signatures, n) < 0)
b971b8
-- 
b971b8
2.26.2
b971b8