[PATCH v2 02/12] libxl: add API wrapper for libxl_retrieve_domain_configuration

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

 



Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_retrieve_domain_configuration, which got a new parameter
"libxl_asyncop_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 | 16 ++++++++++++++++
 src/libxl/libxl_domain.c      |  4 ++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h
index 3b988db5b9..4763947b50 100644
--- a/src/libxl/libxl_api_wrapper.h
+++ b/src/libxl/libxl_api_wrapper.h
@@ -42,3 +42,19 @@ libxlDomainCreateRestoreWrapper(libxl_ctx *ctx,
 
     return ret;
 }
+
+static inline int
+libxlRetrieveDomainConfigurationWrapper(libxl_ctx *ctx,
+                                        uint32_t domid,
+                                        libxl_domain_config *d_config)
+{
+    int ret;
+
+#if LIBXL_API_VERSION < 0x041300
+    ret = libxl_retrieve_domain_configuration(ctx, domid, d_config);
+#else
+    ret = libxl_retrieve_domain_configuration(ctx, domid, d_config, NULL);
+#endif
+
+    return ret;
+}
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 9adba9f2bf..809108fd7d 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -572,8 +572,8 @@ libxlDomainShutdownThread(void *opaque)
     } else if (xl_reason == LIBXL_SHUTDOWN_REASON_SOFT_RESET) {
         libxlDomainObjPrivatePtr priv = vm->privateData;
 
-        if (libxl_retrieve_domain_configuration(cfg->ctx, vm->def->id,
-                                                &d_config) != 0) {
+        if (libxlRetrieveDomainConfigurationWrapper(cfg->ctx, vm->def->id,
+                                                    &d_config) != 0) {
             VIR_ERROR(_("Failed to retrieve config for VM '%s'. "
                         "Unable to perform soft reset. Destroying VM"),
                       vm->def->name);




[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