tech-kern archive

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

Re: Balloon driver.



On Wednesday 07 July 2010 10:30:26 Christoph Egger wrote:
> On Tuesday 06 July 2010 17:02:08 Cherry G. Mathew wrote:
> > On 6 July 2010 09:19, Cherry G. Mathew 
> > <cherry.g.mathew%gmail.com@localhost> wrote:
> > > jym@ and I made a few more changes to this.
> > > Have a look here:
> > > ftp://ftp.netbsd.org/pub/NetBSD/misc/cherry/balloon/
> > >
> > > Any feedback would be much appreciated. If things go well, I'm hoping
> > > to commit this marked "EXPERIMENTAL" "soon".
> >
> > Done.
>
> Thank you for doing this work.
>
> Though I have to report a bug:
>
> I have an amd64 Dom0 kernel w/o XEN_BALLOONING in the kernel config.
> Boot the xen kernel with dom0_mem=512m
>
> After login I do:
>
> # sysctl kern.xen
> kern.xen.balloon.current = 131072
> node_val out of range.
> node_val = 0
>
> I expect kern.xen.balloon.current to say 512MB and I don't expect to see
> the node_val messages.

Attached is a patch which adds ballooning support to the xentools.

Christoph

diff -r 5f0b85ba914e tools/python/xen/xend/osdep.py
--- a/tools/python/xen/xend/osdep.py    Mon Jul 05 15:15:12 2010 +0200
+++ b/tools/python/xen/xend/osdep.py    Wed Jul 07 10:53:06 2010 +0200
@@ -81,13 +81,17 @@ def _linux_balloon_stat(label):
 def _netbsd_balloon_stat(label):
     """Returns the value for the named label, or None if an error occurs."""
 
     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'  : 'kern.xen.balloon.low-balloon',
+                           'high-balloon' : 'kern.xen.balloon.high-balloon',
+                           'limit'        : 'kern.xen.balloon.limit' }
+
+    cmd = "/sbin/sysctl " + xend2netbsd_labels[label]
     sysctloutput = commands.getoutput(cmd)
     (name, value) = sysctloutput.split('=')
     """Return value in KB."""
     return int(value) / 1024
 


Home | Main Index | Thread Index | Old Index