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(a)aepfle.de>
---
src/libxl/libxl_api_wrapper.h | 14 ++++++++++++++
src/libxl/libxl_driver.c | 4 ++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h
index a400bbd5a3..047089ed25 100644
--- a/src/libxl/libxl_api_wrapper.h
+++ b/src/libxl/libxl_api_wrapper.h
@@ -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;
+}
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index a2642e9d94..7c93a9a4db 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -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);