From: Anthony PERARD <anthony.perard@citrix.com>
To: Xen Devel <xen-devel@lists.xen.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 5/6] libxl_qmp: Introduce libxl__qmp_set_global_dirty_log.
Date: Wed, 25 Jul 2012 18:04:16 +0100 [thread overview]
Message-ID: <1343235857-15870-6-git-send-email-anthony.perard@citrix.com> (raw)
In-Reply-To: <1343235857-15870-1-git-send-email-anthony.perard@citrix.com>
This function will enable or disable the global dirty log on QEMU, used during
a migration.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
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
next prev parent reply other threads:[~2012-07-25 17:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-25 17:04 [PATCH 0/6] Set dirty log on qemu-xen Anthony PERARD
2012-07-25 17:04 ` [PATCH 1/6] libxl_json: Export json_object related function Anthony PERARD
2012-07-31 12:50 ` Ian Jackson
2012-07-25 17:04 ` [PATCH 2/6] libxl_json: Introduce libxl__json_object_to_yajl_gen Anthony PERARD
2012-07-31 14:19 ` Ian Jackson
2012-07-25 17:04 ` [PATCH 3/6] libxl_qmp: Introduces helpers to create an argument list Anthony PERARD
2012-07-31 14:27 ` Ian Jackson
2012-07-25 17:04 ` [PATCH 4/6] libxl_qmp: Use qmp_parameters_* functions for param list of a QMP command Anthony PERARD
2012-07-31 14:36 ` Ian Jackson
2012-07-25 17:04 ` Anthony PERARD [this message]
2012-07-31 14:37 ` [PATCH 5/6] libxl_qmp: Introduce libxl__qmp_set_global_dirty_log Ian Jackson
2012-07-25 17:04 ` [PATCH 6/6] libxl_dom: Call the right switch logdirty for the right DM Anthony PERARD
2012-07-31 14:40 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343235857-15870-6-git-send-email-anthony.perard@citrix.com \
--to=anthony.perard@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=ian.campbell@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).