Improve balloon support for NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
This commit is contained in:
Stefano Stabellini committed 2010-07-19 12:22:04 +01:00
1 parent 1f7a33f7c7
commit 19ea926cbc
1 file changed
+11 -5
+11 -5
View File
@@ -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."""
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.