summaryrefslogtreecommitdiff
path: root/xen-all.c
diff options
context:
space:
mode:
authorAnthony PERARD <anthony.perard@citrix.com>2012-10-03 13:48:19 +0000
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-10-03 13:48:19 +0000
commit39f42439d0629d3921629dc4b38e68df8f2f7b83 (patch)
tree4d473e54a7d1d53f54b7451dceabd855bc245dc4 /xen-all.c
parentaabc8530c7ba2be89e21463f051056ad7c255e6e (diff)
downloadqemu-39f42439d0629d3921629dc4b38e68df8f2f7b83.tar.gz
QMP, Introduce xen-set-global-dirty-log command.
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>
Diffstat (limited to 'xen-all.c')
-rw-r--r--xen-all.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xen-all.c b/xen-all.c
index f76b051eee..f75ae9fd28 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)