Patchwork [v8,6/6] xen: do not allocate RAM during INMIGRATE runstate

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

Comments

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

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

Patch

diff --git a/xen-all.c b/xen-all.c
index 972cffd..10d53d1 100644
--- a/xen-all.c
+++ b/xen-all.c
@@ -190,6 +190,14 @@  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 */
+        fprintf(stderr, "%s: do not alloc "RAM_ADDR_FMT
+                " bytes of ram at "RAM_ADDR_FMT" when runstate is INMIGRATE\n",
+                __func__, size, ram_addr); 
+        return;
+    }
+
     if (mr == &ram_memory) {
         return;
     }