[PATCH v2 06/12] libxl: add API wrapper for libxl_domain_unpause

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

 



Upcoming changes will use different LIBXL_API_VERSION variants.

Prepare libxl_domain_unpause, 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_domain.c      |  4 ++--
 src/libxl/libxl_driver.c      |  4 ++--
 src/libxl/libxl_migration.c   |  3 ++-
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/src/libxl/libxl_api_wrapper.h b/src/libxl/libxl_api_wrapper.h
index c912aabadb..13200cfec6 100644
--- a/src/libxl/libxl_api_wrapper.h
+++ b/src/libxl/libxl_api_wrapper.h
@@ -100,3 +100,17 @@ libxlDomainPauseWrapper(libxl_ctx *ctx, uint32_t domid)
 
     return ret;
 }
+
+static inline int
+libxlDomainUnpauseWrapper(libxl_ctx *ctx, uint32_t domid)
+{
+    int ret;
+
+#if LIBXL_API_VERSION < 0x041300
+    ret = libxl_domain_unpause(ctx, domid);
+#else
+    ret = libxl_domain_unpause(ctx, domid, NULL);
+#endif
+
+    return ret;
+}
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 809108fd7d..a034fe2219 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -594,7 +594,7 @@ libxlDomainShutdownThread(void *opaque)
             goto endjob;
         }
         libxl_evenable_domain_death(cfg->ctx, vm->def->id, 0, &priv->deathW);
-        libxl_domain_unpause(cfg->ctx, vm->def->id);
+        libxlDomainUnpauseWrapper(cfg->ctx, vm->def->id);
 #endif
     } else {
         VIR_INFO("Unhandled shutdown_reason %d", xl_reason);
@@ -1459,7 +1459,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
         goto destroy_dom;
 
     if (!start_paused) {
-        libxl_domain_unpause(cfg->ctx, domid);
+        libxlDomainUnpauseWrapper(cfg->ctx, domid);
         virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_BOOTED);
     } else {
         virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_USER);
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index afde679269..a2642e9d94 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1238,7 +1238,7 @@ libxlDomainResume(virDomainPtr dom)
         goto endjob;
 
     if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
-        if (libxl_domain_unpause(cfg->ctx, vm->def->id) != 0) {
+        if (libxlDomainUnpauseWrapper(cfg->ctx, vm->def->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("Failed to resume domain '%d' with libxenlight"),
                            vm->def->id);
@@ -2091,7 +2091,7 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags)
 
  unpause:
     if (virDomainObjIsActive(vm) && paused) {
-        if (libxl_domain_unpause(cfg->ctx, vm->def->id) != 0) {
+        if (libxlDomainUnpauseWrapper(cfg->ctx, vm->def->id) != 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
                            _("After dumping core, failed to resume domain '%d' with"
                              " libxenlight"), vm->def->id);
diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index a5a9df98ad..a99021031d 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -34,6 +34,7 @@
 #include "virthread.h"
 #include "virhook.h"
 #include "rpc/virnetsocket.h"
+#include "libxl_api_wrapper.h"
 #include "libxl_domain.h"
 #include "libxl_driver.h"
 #include "libxl_conf.h"
@@ -1298,7 +1299,7 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn,
 
     /* Unpause if requested */
     if (!(flags & VIR_MIGRATE_PAUSED)) {
-        if (libxl_domain_unpause(cfg->ctx, vm->def->id) != 0) {
+        if (libxlDomainUnpauseWrapper(cfg->ctx, vm->def->id) != 0) {
             virReportError(VIR_ERR_OPERATION_FAILED, "%s",
                            _("Failed to unpause domain"));
             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