From a5163a2500457cd789b7cfc0c5a4e5977604f7e5 Mon Sep 17 00:00:00 2001 From: Adam Glasgall Date: Wed, 24 Apr 2013 21:44:41 -0400 Subject: [PATCH] min target kb doesn't seem to be exposed anymore --- debian/changelog | 7 +++++++ host/usr/sbin/invirt-availability | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 95a7429..59ca679 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,13 @@ invirt-remote (0.4.16) unstable; urgency=low -- Peter A. Iannucci Tue, 28 May 2013 20:19:00 -0400 +invirt-remote (0.4.15~glasgall9) precise; urgency=low + + * Xen dom0 minimum target memory doesn't seem to be exposed + anymore. Temporarily (?) trust the admin to set dom0-min-mem properly. + + -- Adam Glasgall Wed, 24 Apr 2013 21:43:55 -0400 + invirt-remote (0.4.15~glasgall8) precise; urgency=low * Oops, right, Python doesn't auto-coerce strings to ints. Thankfully. diff --git a/host/usr/sbin/invirt-availability b/host/usr/sbin/invirt-availability index 729c229..70306dd 100644 --- a/host/usr/sbin/invirt-availability +++ b/host/usr/sbin/invirt-availability @@ -35,7 +35,9 @@ def main(argv): free_memory = int(xminfo['free_memory']) * 1024 currentallocation = int(open('/sys/devices/system/xen_memory/xen_memory0/info/current_kb', 'r').read()) - minimumtarget = int(open('/sys/devices/system/xen_memory/xen_memory0/target_kb', 'r').read()) +# this information seems to have vanished in recent linux - we _want_ min_target_kb, but it doesn't seem to be +# exposed anymore. +# minimumtarget = int(open('/sys/devices/system/xen_memory/xen_memory0/target_kb', 'r').read()) p = Popen(['/usr/sbin/xm', 'info', '-c'], stdout=PIPE) output = p.communicate()[0] if p.returncode != 0: @@ -46,7 +48,8 @@ def main(argv): # In kibibytes dom0minmem = int(xminfoc['dom0-min-mem']) * 1024 - dom0_spare_memory = currentallocation - max(minimumtarget, dom0minmem) +# dom0_spare_memory = currentallocation - max(minimumtarget, dom0minmem) + dom0_spare_memory = currentallocation - dom0minmem print int((free_memory + dom0_spare_memory)/1024) return 0 -- 1.7.9.5