mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
cpu_x86: Add virCPUDataGetHost
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
cb79953b88
commit
19b52d952b
@ -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:
|
||||
*
|
||||
|
@ -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);
|
||||
|
||||
|
@ -1462,6 +1462,7 @@ virCPUDataAddFeature;
|
||||
virCPUDataCheckFeature;
|
||||
virCPUDataFormat;
|
||||
virCPUDataFree;
|
||||
virCPUDataGetHost;
|
||||
virCPUDataIsIdentical;
|
||||
virCPUDataNew;
|
||||
virCPUDataNewCopy;
|
||||
|
Loading…
x
Reference in New Issue
Block a user