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

[Xen-devel] [PATCH 5/6] libxl_qmp: Introduce libxl__qmp_set_global_dirty_log.



This function will enable or disable the global dirty log on QEMU, used during
a migration.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 tools/libxl/libxl_internal.h |    2 ++
 tools/libxl/libxl_qmp.c      |   27 +++++++++++++++++++++++++--
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 2176778..5af4f5c 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1353,6 +1353,8 @@ _hidden int libxl__qmp_stop(libxl__gc *gc, int domid);
 _hidden int libxl__qmp_resume(libxl__gc *gc, int domid);
 /* Save current QEMU state into fd. */
 _hidden int libxl__qmp_save(libxl__gc *gc, int domid, const char *filename);
+/* Set dirty bitmap logging status */
+_hidden int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool 
enable);
 /* close and free the QMP handler */
 _hidden void libxl__qmp_close(libxl__qmp_handler *qmp);
 /* remove the socket file, if the file has already been removed,
diff --git a/tools/libxl/libxl_qmp.c b/tools/libxl/libxl_qmp.c
index 8bd56cf..2c5559f 100644
--- a/tools/libxl/libxl_qmp.c
+++ b/tools/libxl/libxl_qmp.c
@@ -686,7 +686,6 @@ error_nomem:
     return NULL;
 }
 
-#if 0
 static libxl__json_object *qmp_parameters_add_bool(libxl__gc *gc,
                                                    libxl__json_object *param,
                                                    const char *name, bool b)
@@ -707,7 +706,6 @@ error_nomem:
     libxl__json_object_free(gc, obj);
     return NULL;
 }
-#endif
 
 /*
  * API
@@ -1001,6 +999,31 @@ int libxl__qmp_resume(libxl__gc *gc, int domid)
     return rc;
 }
 
+int libxl__qmp_set_global_dirty_log(libxl__gc *gc, int domid, bool enable)
+{
+    libxl__qmp_handler *qmp = NULL;
+    libxl__json_object *args = NULL;
+    int rc = 0;
+
+    qmp = libxl__qmp_initialize(gc, domid);
+    if (!qmp)
+        return ERROR_FAIL;
+
+    args = qmp_parameters_add_bool(gc, NULL, "enable", enable);
+    if (!args) {
+        rc = ERROR_NOMEM;
+        goto out;
+    }
+
+    rc = qmp_synchronous_send(qmp, "xen-set-global-dirty-log", args,
+                              NULL, NULL, qmp->timeout);
+    libxl__json_object_free(gc, args);
+
+out:
+    libxl__qmp_close(qmp);
+    return rc;
+}
+
 int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
                                const libxl_domain_config *guest_config)
 {
-- 
Anthony PERARD


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.