[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Improve balloon support for NetBSD.



# HG changeset patch
# User Stefano Stabellini <sstabellini@xxxxxxxxxxxxx>
# Date 1279538524 -3600
# Node ID 092da4a970aca76920232fa52cb3bd9b7c160956
# Parent  9ccd024065c591071a22616fb00b854e2836ed33
Improve balloon support for NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
 tools/python/xen/xend/osdep.py |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff -r 9ccd024065c5 -r 092da4a970ac tools/python/xen/xend/osdep.py
--- a/tools/python/xen/xend/osdep.py    Mon Jul 19 12:21:24 2010 +0100
+++ b/tools/python/xen/xend/osdep.py    Mon Jul 19 12:22:04 2010 +0100
@@ -83,13 +83,19 @@ def _netbsd_balloon_stat(label):
 
     import commands
 
-    if label != 'current':
-       return None
-    cmd = "/sbin/sysctl hw.physmem64"
+    xend2netbsd_labels = { 'current'      : 'kern.xen.balloon.current',
+                           'target'       : 'kern.xen.balloon.target',
+                           'low-balloon'  : None,
+                           'high-balloon' : None,
+                           'limit'        : None }
+
+    cmdarg = xend2netbsd_labels[label]
+    if cmdarg is None:
+        return None
+    cmd = "/sbin/sysctl " + cmdarg
     sysctloutput = commands.getoutput(cmd)
     (name, value) = sysctloutput.split('=')
-    """Return value in KB."""
-    return int(value) / 1024
+    return int(value)
 
 def _solaris_balloon_stat(label):
     """Returns the value for the named label, or None if an error occurs."""

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.