[PATCH v2 10/12] libxl: add API wrapper for libxl_send_trigger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 src/libxl/libxl_api_wrapper.h | 17 +++++++++++++++++
 src/libxl/libxl_driver.c      |  4 ++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h
index 047089ed25..26c2215cb7 100644
--- a/src/libxl/libxl_api_wrapper.h
+++ b/src/libxl/libxl_api_wrapper.h
@@ -171,3 +171,20 @@ libxlSetVcpuonlineWrapper(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap)
 
     return ret;
 }
+
+static inline int
+libxlSendTriggerWrapper(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 7c93a9a4db..18098734fc 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1308,8 +1308,8 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
     }
 
     if (flags & VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN) {
-        ret = libxl_send_trigger(cfg->ctx, vm->def->id,
-                                 LIBXL_TRIGGER_POWER, 0);
+        ret = libxlSendTriggerWrapper(cfg->ctx, vm->def->id,
+                                      LIBXL_TRIGGER_POWER, 0);
         if (ret == 0)
             goto cleanup;
 




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux