Upcoming changes will use different LIBXL_API_VERSION variants.
Prepare libxl_send_trigger, 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.h | 17 +++++++++++++++++
src/libxl/libxl_driver.c | 2 +-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/libxl/libxl_api.h b/src/libxl/libxl_api.h
index 415e2cb32c..c7174f5133 100644
--- a/src/libxl/libxl_api.h
+++ b/src/libxl/libxl_api.h
@@ -171,3 +171,20 @@ Libxl_Set_Vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap
*cpumap)
return ret;
}
+
+static inline int
+Libxl_Send_Trigger(libxl_ctx *ctx,
+ uint32_t domid,
+ libxl_trigger trigger,
+ uint32_t vcpuid)
+{
+ int ret;
+
+#if LIBXL_API_VERSION < 0x041300
+ ret = libxl_send_trigger(ctx, domid, trigger, vcpuid);
+#else
+ ret = libxl_send_trigger(ctx, domid, trigger, vcpuid, NULL);
+#endif
+
+ return ret;
+}
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 1d37ae6c89..cf3a2d9775 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1308,7 +1308,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
}
if (flags & VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) {
- ret = libxl_send_trigger(cfg->ctx, vm->def->id,
+ ret = Libxl_Send_Trigger(cfg->ctx, vm->def->id,
LIBXL_TRIGGER_POWER, 0);
if (ret == 0)
goto cleanup;