WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] Remus: fix shadow memory allocation, brok

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Remus: fix shadow memory allocation, broken by 20558:4ed3b9b1de3f
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 03 Dec 2009 08:35:11 -0800
Delivery-date: Thu, 03 Dec 2009 08:35:09 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259848214 0
# Node ID 9b6b398464b7bf1afd3f6cbac02e7590b9d1d516
# Parent  aa0b5558564f882903ca1c84948bc2a3619d9f73
Remus: fix shadow memory allocation, broken by 20558:4ed3b9b1de3f

This approach is perhaps a little cleaner than directly calling
balloon.free.

Signed-off-by: Brendan Cully <brendan@xxxxxxxxx>
---
 tools/python/xen/remus/vm.py |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff -r aa0b5558564f -r 9b6b398464b7 tools/python/xen/remus/vm.py
--- a/tools/python/xen/remus/vm.py      Wed Dec 02 18:46:14 2009 +0000
+++ b/tools/python/xen/remus/vm.py      Thu Dec 03 13:50:14 2009 +0000
@@ -3,9 +3,8 @@ import xmlrpclib
 import xmlrpclib
 
 from xen.xend.XendClient import server
-from xen.xend import sxp
-# XXX XendDomain is voodoo to let balloon import succeed
-from xen.xend import XendDomain, balloon
+from xen.xend import sxp, osdep
+from xen.lowlevel.xc import xc
 
 import vif
 import blkdev
@@ -150,7 +149,13 @@ def getshadowmem(vm):
     # from XendDomainInfo.checkLiveMigrateMemory:
     # 1MB per vcpu plus 4Kib/Mib of RAM.  This is higher than
     # the minimum that Xen would allocate if no value were given.
-    needed = vcpus * 1024 + maxmem * 4 - shadow * 1024
+    shadowneeded = vcpus * 1024 + maxmem * 4 - shadow * 1024
+    physinfo = xc().physinfo()
+    freemem = int(physinfo['free_memory'])
+    needed = shadowneeded - freemem
     if needed > 0:
         print "Freeing %d kB for shadow mode" % needed
-        balloon.free(needed, vm.dominfo)
+        dom0cur = osdep.lookup_balloon_stat('current')
+        # target is in MB, not KB
+        target = (dom0cur - needed) / 1024
+        server.xend.domain.setMemoryTarget(0, target)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Remus: fix shadow memory allocation, broken by 20558:4ed3b9b1de3f, Xen patchbot-unstable <=