mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Improve balloon support for NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
This commit is contained in:
1 parent
1f7a33f7c7
commit
19ea926cbc
1 file changed
+11
-5
@@ -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."""
|
||||
|
||||