From: Luiz Capitulino <lcapitulino@redhat.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Xen Devel <xen-devel@lists.xen.org>,
Stefano Stabellini <stefano.stabellini@citrix.com>,
QEMU-devel <qemu-devel@nongnu.org>, Avi Kivity <avi@redhat.com>
Subject: Re: [Qemu-devel] [PATCH V2 1/5] QMP, Introduce xen-set-global-dirty-log command.
Date: Fri, 27 Jul 2012 13:30:05 -0300 [thread overview]
Message-ID: <20120727133005.19bab01a@doriath.home> (raw)
In-Reply-To: <1342794882-30648-2-git-send-email-anthony.perard@citrix.com>
On Fri, 20 Jul 2012 15:34:38 +0100
Anthony PERARD <anthony.perard@citrix.com> wrote:
> This command is used during a migration of a guest under Xen. It calls
> memory_global_dirty_log_start or memory_global_dirty_log_stop according to the
> argument pass to the command.
>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
> ---
> qapi-schema.json | 13 +++++++++++++
> qmp-commands.hx | 24 ++++++++++++++++++++++++
> xen-all.c | 15 +++++++++++++++
> xen-stub.c | 5 +++++
> 4 files changed, 57 insertions(+), 0 deletions(-)
>
> diff --git a/qapi-schema.json b/qapi-schema.json
> index a92adb1..e521ea4 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -1765,6 +1765,19 @@
> { 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
>
> ##
> +# @xen-set-global-dirty-log
> +#
> +# Enable or disable the global dirty log mode.
> +#
> +# @enable: true to enable, false to disable.
> +#
> +# Returns: nothing
> +#
> +# Since: 1.2
> +##
> +{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
> +
> +##
> # @device_del:
> #
> # Remove a device from a guest
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index e3cf3c5..961f5c0 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -468,6 +468,30 @@ Example:
> EQMP
>
> {
> + .name = "xen-set-global-dirty-log",
> + .args_type = "enable:b",
> + .mhandler.cmd_new = qmp_marshal_input_xen_set_global_dirty_log,
> + },
> +
> +SQMP
> +xen-set-global-dirty-log
> +-------
> +
> +Enable or disable the global dirty log mode.
> +
> +Arguments:
> +
> +- "enable": Enable it or disable it.
> +
> +Example:
> +
> +-> { "execute": "xen-set-global-dirty-log",
> + "arguments": { "enable": true } }
> +<- { "return": {} }
> +
> +EQMP
> +
> + {
> .name = "migrate",
> .args_type = "detach:-d,blk:-b,inc:-i,uri:s",
> .mhandler.cmd_new = qmp_marshal_input_migrate,
> diff --git a/xen-all.c b/xen-all.c
> index 61def2e..e9c7ebf 100644
> --- a/xen-all.c
> +++ b/xen-all.c
> @@ -14,6 +14,7 @@
> #include "hw/pc.h"
> #include "hw/xen_common.h"
> #include "hw/xen_backend.h"
> +#include "qmp-commands.h"
>
> #include "range.h"
> #include "xen-mapcache.h"
> @@ -36,6 +37,7 @@
>
> static MemoryRegion ram_memory, ram_640k, ram_lo, ram_hi;
> static MemoryRegion *framebuffer;
> +static bool xen_in_migration;
>
> /* Compatibility with older version */
> #if __XEN_LATEST_INTERFACE_VERSION__ < 0x0003020a
> @@ -552,10 +554,14 @@ static void xen_log_sync(MemoryListener *listener, MemoryRegionSection *section)
>
> static void xen_log_global_start(MemoryListener *listener)
> {
> + if (xen_enabled()) {
> + xen_in_migration = true;
> + }
> }
>
> static void xen_log_global_stop(MemoryListener *listener)
> {
> + xen_in_migration = false;
> }
>
> static void xen_eventfd_add(MemoryListener *listener,
> @@ -588,6 +594,15 @@ static MemoryListener xen_memory_listener = {
> .priority = 10,
> };
>
> +void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
> +{
> + if (enable) {
> + memory_global_dirty_log_start();
> + } else {
> + memory_global_dirty_log_stop();
> + }
> +}
> +
> /* VCPU Operations, MMIO, IO ring ... */
>
> static void xen_reset_vcpu(void *opaque)
> diff --git a/xen-stub.c b/xen-stub.c
> index 8ff2b79..5e66ba8 100644
> --- a/xen-stub.c
> +++ b/xen-stub.c
> @@ -11,6 +11,7 @@
> #include "qemu-common.h"
> #include "hw/xen.h"
> #include "memory.h"
> +#include "qmp-commands.h"
>
> void xenstore_store_pv_console_info(int i, CharDriverState *chr)
> {
> @@ -54,3 +55,7 @@ int xen_init(void)
> void xen_register_framebuffer(MemoryRegion *mr)
> {
> }
> +
> +void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
> +{
> +}
next prev parent reply other threads:[~2012-07-27 16:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 14:34 [Qemu-devel] [PATCH V2 0/5] Xen, introducing dirty log for migration Anthony PERARD
2012-07-20 14:34 ` [Qemu-devel] [PATCH V2 1/5] QMP, Introduce xen-set-global-dirty-log command Anthony PERARD
2012-07-27 16:30 ` Luiz Capitulino [this message]
2012-07-20 14:34 ` [Qemu-devel] [PATCH V2 2/5] xen: Introduce xen_modified_memory Anthony PERARD
2012-07-20 14:34 ` [Qemu-devel] [PATCH V2 3/5] exec: Introduce helper to set dirty flags Anthony PERARD
2012-07-29 12:58 ` Avi Kivity
2012-07-20 14:34 ` [Qemu-devel] [PATCH V2 4/5] exec, memory: Call to xen_modified_memory Anthony PERARD
2012-07-20 14:34 ` [Qemu-devel] [PATCH V2 5/5] xen: Always set the vram dirty during migration Anthony PERARD
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=20120727133005.19bab01a@doriath.home \
--to=lcapitulino@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=anthony.perard@citrix.com \
--cc=avi@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@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).