|
Pablo Greco |
40546a |
From 0b98a3d385f3d46949c5b2bc15c27c7c62739496 Mon Sep 17 00:00:00 2001
|
|
Pablo Greco |
40546a |
Message-Id: <0b98a3d385f3d46949c5b2bc15c27c7c62739496@dist-git>
|
|
Pablo Greco |
40546a |
From: Jiri Denemark <jdenemar@redhat.com>
|
|
Pablo Greco |
40546a |
Date: Fri, 21 Jun 2019 09:24:59 +0200
|
|
Pablo Greco |
40546a |
Subject: [PATCH] cpu_x86: Add x86ModelCopySignatures helper
|
|
Pablo Greco |
40546a |
MIME-Version: 1.0
|
|
Pablo Greco |
40546a |
Content-Type: text/plain; charset=UTF-8
|
|
Pablo Greco |
40546a |
Content-Transfer-Encoding: 8bit
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
Introduce a helper for copying CPU signature between two CPU models.
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
It's not very useful until the way we store signatures is changed in the
|
|
Pablo Greco |
40546a |
next patch.
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
Pablo Greco |
40546a |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
Pablo Greco |
40546a |
(cherry picked from commit 2254c1cfb854dfc52f3b4bfdfca2bd995b0a163c)
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
https://bugzilla.redhat.com/show_bug.cgi?id=1686895
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
Pablo Greco |
40546a |
Message-Id: <eb973566dab0f8d77ff536e4c56eb6bffd77928f.1561068591.git.jdenemar@redhat.com>
|
|
Pablo Greco |
40546a |
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
|
Pablo Greco |
40546a |
---
|
|
Pablo Greco |
40546a |
src/cpu/cpu_x86.c | 16 +++++++++++++---
|
|
Pablo Greco |
40546a |
1 file changed, 13 insertions(+), 3 deletions(-)
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
|
|
Pablo Greco |
40546a |
index 51cb9b7143..e25bc691ae 100644
|
|
Pablo Greco |
40546a |
--- a/src/cpu/cpu_x86.c
|
|
Pablo Greco |
40546a |
+++ b/src/cpu/cpu_x86.c
|
|
Pablo Greco |
40546a |
@@ -977,6 +977,16 @@ x86ModelFree(virCPUx86ModelPtr model)
|
|
Pablo Greco |
40546a |
}
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
+static int
|
|
Pablo Greco |
40546a |
+x86ModelCopySignatures(virCPUx86ModelPtr dst,
|
|
Pablo Greco |
40546a |
+ virCPUx86ModelPtr src)
|
|
Pablo Greco |
40546a |
+{
|
|
Pablo Greco |
40546a |
+ dst->signature = src->signature;
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+ return 0;
|
|
Pablo Greco |
40546a |
+}
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
+
|
|
Pablo Greco |
40546a |
static virCPUx86ModelPtr
|
|
Pablo Greco |
40546a |
x86ModelCopy(virCPUx86ModelPtr model)
|
|
Pablo Greco |
40546a |
{
|
|
Pablo Greco |
40546a |
@@ -984,13 +994,13 @@ x86ModelCopy(virCPUx86ModelPtr model)
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
if (VIR_ALLOC(copy) < 0 ||
|
|
Pablo Greco |
40546a |
VIR_STRDUP(copy->name, model->name) < 0 ||
|
|
Pablo Greco |
40546a |
+ x86ModelCopySignatures(copy, model) < 0 ||
|
|
Pablo Greco |
40546a |
x86DataCopy(©->data, &model->data) < 0) {
|
|
Pablo Greco |
40546a |
x86ModelFree(copy);
|
|
Pablo Greco |
40546a |
return NULL;
|
|
Pablo Greco |
40546a |
}
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
copy->vendor = model->vendor;
|
|
Pablo Greco |
40546a |
- copy->signature = model->signature;
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
return copy;
|
|
Pablo Greco |
40546a |
}
|
|
Pablo Greco |
40546a |
@@ -1176,8 +1186,8 @@ x86ModelParseAncestor(virCPUx86ModelPtr model,
|
|
Pablo Greco |
40546a |
}
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
model->vendor = ancestor->vendor;
|
|
Pablo Greco |
40546a |
- model->signature = ancestor->signature;
|
|
Pablo Greco |
40546a |
- if (x86DataCopy(&model->data, &ancestor->data) < 0)
|
|
Pablo Greco |
40546a |
+ if (x86ModelCopySignatures(model, ancestor) < 0 ||
|
|
Pablo Greco |
40546a |
+ x86DataCopy(&model->data, &ancestor->data) < 0)
|
|
Pablo Greco |
40546a |
return -1;
|
|
Pablo Greco |
40546a |
|
|
Pablo Greco |
40546a |
return 0;
|
|
Pablo Greco |
40546a |
--
|
|
Pablo Greco |
40546a |
2.22.0
|
|
Pablo Greco |
40546a |
|