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