[PATCH v1 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.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.h b/src/libxl/libxl_api.h
index 947e0c8d47..86d2d64b37 100644
--- a/src/libxl/libxl_api.h
+++ b/src/libxl/libxl_api.h
@@ -100,3 +100,17 @@ Libxl_Domain_Pause(libxl_ctx *ctx, uint32_t domid)
 
     return ret;
 }
+
+static inline int
+Libxl_Domain_Unpause(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 d970a05f3a..6eca7027eb 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);
+        Libxl_Domain_Unpause(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);
+        Libxl_Domain_Unpause(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 929e8195f0..2823cdb9d8 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 (Libxl_Domain_Unpause(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 (Libxl_Domain_Unpause(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..f65f68b839 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.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 (Libxl_Domain_Unpause(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