1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00

libxl: implement virConnectBaselineCPU

Akin to previous commit but for "virsh cpu-baseline" which
computes a baseline CPU for a set of host cpu elements.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Joao Martins 2016-07-20 20:08:49 +01:00 committed by Michal Privoznik
parent 5822b740ad
commit 69f4030aad

View File

@ -6386,6 +6386,26 @@ libxlConnectCompareCPU(virConnectPtr conn,
return ret;
}
static char *
libxlConnectBaselineCPU(virConnectPtr conn,
const char **xmlCPUs,
unsigned int ncpus,
unsigned int flags)
{
char *cpu = NULL;
virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES |
VIR_CONNECT_BASELINE_CPU_MIGRATABLE, NULL);
if (virConnectBaselineCPUEnsureACL(conn) < 0)
goto cleanup;
cpu = cpuBaselineXML(xmlCPUs, ncpus, NULL, 0, flags);
cleanup:
return cpu;
}
static virHypervisorDriver libxlHypervisorDriver = {
.name = LIBXL_DRIVER_NAME,
.connectOpen = libxlConnectOpen, /* 0.9.0 */
@ -6491,6 +6511,7 @@ static virHypervisorDriver libxlHypervisorDriver = {
.domainInterfaceAddresses = libxlDomainInterfaceAddresses, /* 1.3.5 */
.connectGetDomainCapabilities = libxlConnectGetDomainCapabilities, /* 2.0.0 */
.connectCompareCPU = libxlConnectCompareCPU, /* 2.3.0 */
.connectBaselineCPU = libxlConnectBaselineCPU, /* 2.3.0 */
};
static virConnectDriver libxlConnectDriver = {