From: Stefano Stabellini Date: Mon, 19 Jul 2010 11:22:04 +0000 (+0100) Subject: Improve balloon support for NetBSD. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11759^2~9 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=19ea926cbc9a462f72fb9e072019c3ff355af1c2;p=xen.git Improve balloon support for NetBSD. Signed-off-by: Christoph Egger --- diff --git a/tools/python/xen/xend/osdep.py b/tools/python/xen/xend/osdep.py index c3dea72a00..3a09b5244c 100644 --- a/tools/python/xen/xend/osdep.py +++ b/tools/python/xen/xend/osdep.py @@ -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."""