Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/cpu/cpu.c | 19 +++++++++++++++++++ src/cpu/cpu.h | 7 +++++++ src/libvirt_private.syms | 1 + 3 files changed, 27 insertions(+) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index b5669246b4..285c7eee44 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -1190,6 +1190,25 @@ virCPUDataIsIdentical(const virCPUData *a, } +/** + * virCPUDataGetHost: + * + */ +virCPUData* +virCPUDataGetHost(void) +{ + struct cpuArchDriver *driver; + + if (!(driver = cpuGetSubDriver(virArchFromHost()))) + return NULL; + + if (!driver->dataGetHost) + return NULL; + + return driver->dataGetHost(); +} + + /** * virCPUArchIsSupported: * diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index d3e5ca79f2..071b33fe76 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -130,6 +130,9 @@ typedef virCPUCompareResult (*virCPUArchDataIsIdentical)(const virCPUData *a, const virCPUData *b); +typedef virCPUData * +(*virCPUArchDataGetHost)(void); + struct cpuArchDriver { const char *name; const virArch *arch; @@ -155,6 +158,7 @@ struct cpuArchDriver { virCPUArchValidateFeatures validateFeatures; virCPUArchDataAddFeature dataAddFeature; virCPUArchDataIsIdentical dataIsIdentical; + virCPUArchDataGetHost dataGetHost; }; @@ -291,6 +295,9 @@ virCPUCompareResult virCPUDataIsIdentical(const virCPUData *a, const virCPUData *b); +virCPUData* +virCPUDataGetHost(void); + bool virCPUArchIsSupported(virArch arch); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index e92670c85d..d4e2d3db74 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1460,6 +1460,7 @@ virCPUDataAddFeature; virCPUDataCheckFeature; virCPUDataFormat; virCPUDataFree; +virCPUDataGetHost; virCPUDataIsIdentical; virCPUDataNew; virCPUDataNewCopy; -- 2.31.1