1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-26 03:21:44 +03:00

libxl: add API wrapper for libxl_set_vcpuonline

Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_set_vcpuonline, which got a new parameter
"ao_how" in Xen 4.12. libvirt does not use this parameter.

No functional change intended.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Olaf Hering 2021-03-25 17:26:09 +01:00 committed by Jim Fehlig
parent e8fd24d810
commit 06393ff7d3
2 changed files with 16 additions and 2 deletions

View File

@ -157,3 +157,17 @@ libxlGetFreeMemoryWrapper(libxl_ctx *ctx, uint64_t *memkb)
return ret;
}
static inline int
libxlSetVcpuonlineWrapper(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
{
int ret;
#if LIBXL_API_VERSION < 0x041300
ret = libxl_set_vcpuonline(ctx, domid, cpumap);
#else
ret = libxl_set_vcpuonline(ctx, domid, cpumap, NULL);
#endif
return ret;
}

View File

@ -2331,7 +2331,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
break;
case VIR_DOMAIN_VCPU_LIVE:
if (libxl_set_vcpuonline(cfg->ctx, vm->def->id, &map) != 0) {
if (libxlSetVcpuonlineWrapper(cfg->ctx, vm->def->id, &map) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set vcpus for domain '%d'"
" with libxenlight"), vm->def->id);
@ -2342,7 +2342,7 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
break;
case VIR_DOMAIN_VCPU_LIVE | VIR_DOMAIN_VCPU_CONFIG:
if (libxl_set_vcpuonline(cfg->ctx, vm->def->id, &map) != 0) {
if (libxlSetVcpuonlineWrapper(cfg->ctx, vm->def->id, &map) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to set vcpus for domain '%d'"
" with libxenlight"), vm->def->id);