Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:olh:xen-4.8
libvirt-7.0.0
libvirt.06393ff7d31da344223274e27e8055de90c8708...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libvirt.06393ff7d31da344223274e27e8055de90c87082.patch of Package libvirt-7.0.0
From: Olaf Hering <olaf@aepfle.de> Date: Thu, 25 Mar 2021 17:26:09 +0100 Subject: 06393ff7d31da344223274e27e8055de90c87082 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> --- src/libxl/libxl_api_wrapper.h | 14 ++++++++++++++ src/libxl/libxl_driver.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) --- a/src/libxl/libxl_api_wrapper.h +++ b/src/libxl/libxl_api_wrapper.h @@ -148,12 +148,26 @@ libxlGetFreeMemoryWrapper(libxl_ctx *ctx, uint64_t *memkb) { uint32_t val32 = 0; ret = libxl_get_free_memory(ctx, &val32); *memkb = val32; } #else ret = libxl_get_free_memory(ctx, memkb); #endif 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; +} --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -2325,36 +2325,36 @@ libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, switch (flags) { case VIR_DOMAIN_VCPU_MAXIMUM | VIR_DOMAIN_VCPU_CONFIG: if (virDomainDefSetVcpusMax(def, nvcpus, driver->xmlopt) < 0) goto cleanup; break; case VIR_DOMAIN_VCPU_CONFIG: if (virDomainDefSetVcpus(def, nvcpus) < 0) goto cleanup; 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); goto endjob; } if (virDomainDefSetVcpus(vm->def, nvcpus) < 0) goto endjob; 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); goto endjob; } if (virDomainDefSetVcpus(vm->def, nvcpus) < 0 || virDomainDefSetVcpus(def, nvcpus) < 0) goto endjob; break; } ret = 0;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor