[PATCH v2 03/12] libxl: add API wrapper for libxl_domain_shutdown

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

 



Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_domain_shutdown, 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 | 14 ++++++++++++++
 src/libxl/libxl_driver.c      |  3 ++-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h
index 4763947b50..8b25c3fc9e 100644
--- a/src/libxl/libxl_api_wrapper.h
+++ b/src/libxl/libxl_api_wrapper.h
@@ -58,3 +58,17 @@ libxlRetrieveDomainConfigurationWrapper(libxl_ctx *ctx,
 
     return ret;
 }
+
+static inline int
+libxlDomainShutdownWrapper(libxl_ctx *ctx, uint32_t domid)
+{
+    int ret;
+
+#if LIBXL_API_VERSION < 0x041300
+    ret = libxl_domain_shutdown(ctx, domid);
+#else
+    ret = libxl_domain_shutdown(ctx, domid, NULL);
+#endif
+
+    return ret;
+}
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index e3d769b5d9..d5e53154de 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -37,6 +37,7 @@
 #include "viruuid.h"
 #include "virhook.h"
 #include "vircommand.h"
+#include "libxl_api_wrapper.h"
 #include "libxl_domain.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
@@ -1292,7 +1293,7 @@ libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags)
         goto cleanup;
 
     if (flags & VIR_DOMAIN_SHUTDOWN_PARAVIRT) {
-        ret = libxl_domain_shutdown(cfg->ctx, vm->def->id);
+        ret = libxlDomainShutdownWrapper(cfg->ctx, vm->def->id);
         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