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@xxxxxxxxxx> --- src/libxl/libxl_driver.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 32bf150..a00dd55 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -60,6 +60,7 @@ #include "network/bridge_driver.h" #include "locking/domain_lock.h" #include "virstats.h" +#include "cpu/cpu.h" #define VIR_FROM_THIS VIR_FROM_LIBXL @@ -5777,6 +5778,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 */ @@ -5880,6 +5901,7 @@ static virHypervisorDriver libxlHypervisorDriver = { .domainInterfaceAddresses = libxlDomainInterfaceAddresses, /* 1.3.5 */ .connectGetDomainCapabilities = libxlConnectGetDomainCapabilities, /* 2.0.0 */ .connectCompareCPU = libxlConnectCompareCPU, /* 2.1.0 */ + .connectBaselineCPU = libxlConnectBaselineCPU, /* 2.1.0 */ }; static virConnectDriver libxlConnectDriver = { -- 2.1.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list