Patchwork [v3,6/6] xen: change memory access behavior during migration.

login
register
mail settings
Submitter Stefano Stabellini
Date Jan. 19, 2012, 11:56 a.m.
Message ID <1326974181-32511-6-git-send-email-stefano.stabellini@eu.citrix.com>
Download mbox | patch
Permalink /patch/136884/
State New
Headers show

Comments

Stefano Stabellini - Jan. 19, 2012, 11:56 a.m.
From: Anthony PERARD <anthony.perard@citrix.com>

Do not allocate RAM during INMIGRATE runstate.
Do not actually "do" set_memory during migration.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 xen-all.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch

diff --git a/xen-all.c b/xen-all.c
index c830cb1..bac06fd 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -190,6 +190,11 @@  void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr)
     xen_pfn_t *pfn_list;
     int i;
 
+    if (runstate_check(RUN_STATE_INMIGRATE)) {
+        /* RAM already populated in Xen */
+        return;
+    }
+
     if (mr == &ram_memory) {
         return;
     }
@@ -255,6 +260,10 @@  static int xen_add_to_physmap(XenIOState *state,
     target_phys_addr_t phys_offset = memory_region_get_ram_addr(mr);
     char path[80], value[17];
 
+    if (runstate_check(RUN_STATE_INMIGRATE)) {
+        return 0;
+    }
+
     if (get_physmapping(state, start_addr, size)) {
         return 0;
     }