The API is useful for creating virCPUData in a hypervisor driver from
data we got by querying the hypervisor.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Notes:
Version 3:
- ACKed in v2
- better commit message
- #include "cpu/cpu_x86.h" in qemu_capabilities.c moved to the patch
which makes use of the API
Version 2:
- no change
src/cpu/cpu_x86.c | 11 +++++++++++
src/cpu/cpu_x86.h | 4 ++++
src/libvirt_private.syms | 1 +
3 files changed, 16 insertions(+)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 029a7d475..e3f860bc6 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -2720,6 +2720,17 @@ virCPUx86DataAddCPUID(virCPUDataPtr cpuData,
}
+int
+virCPUx86DataSetSignature(virCPUDataPtr cpuData,
+ unsigned int family,
+ unsigned int model)
+{
+ uint32_t signature = x86MakeSignature(family, model);
+
+ return x86DataAddSignature(&cpuData->data.x86, signature);
+}
+
+
struct cpuArchDriver cpuDriverX86 = {
.name = "x86",
.arch = archs,
diff --git a/src/cpu/cpu_x86.h b/src/cpu/cpu_x86.h
index 79e78a007..ffbd064b4 100644
--- a/src/cpu/cpu_x86.h
+++ b/src/cpu/cpu_x86.h
@@ -32,4 +32,8 @@ extern struct cpuArchDriver cpuDriverX86;
int virCPUx86DataAddCPUID(virCPUDataPtr cpuData,
const virCPUx86CPUID *cpuid);
+int virCPUx86DataSetSignature(virCPUDataPtr cpuData,
+ unsigned int family,
+ unsigned int model);
+
#endif /* __VIR_CPU_X86_H__ */
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 145e23bd8..71eb97f01 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1003,6 +1003,7 @@ virCPUUpdate;
# cpu/cpu_x86.h
virCPUx86DataAddCPUID;
+virCPUx86DataSetSignature;
# datatypes.h
--
2.11.1