Implement auto-ballooning for Solaris
PATCH 1/1 Implement auto-ballooning for Solaris
# HG changeset patch
# User [email protected]
# Date 1174600845 25200
# Node ID 9a830a5502563c5f95378c6d51d969a1cf8f350b # Parent 507cf151b3c0302ce25ef153d01f4460a4c70c70 Implement auto-ballooning for Solaris
/proc/xen/balloon is Linux-specific. Implement a Solaris backend too. Also fix the FMRI for xend.
Signed-off-by Ryan Scott <[email protected]>
tools/python/xen/lowlevel/scf/scf.c +1 -1
@@ -26,7 +26,7 @@#include <libscf.h> #include <stdio.h> -#define XEND_FMRI "svc:/system/xen/xend:default" +#define XEND_FMRI "svc:/system/xctl/xend:default"#define XEND_PG "config"static PyObject *scf_exc;
tools/python/xen/xend/balloon.py +2 -16
@@ -25,9 +25,7 @@ import XendOptions import XendOptions from XendLogging import log from XendError import VmError - - -PROC_XEN_BALLOON = '/proc/xen/balloon' +import osdep RETRY_LIMIT = 20 RETRY_LIMIT_INCR = 5
@@ -51,19 +49,7 @@ def _get_proc_balloon(label): """Returns the value for the named label. Returns None if the label was not found or the value was non-numeric.""" - f = file(PROC_XEN_BALLOON, 'r') - try: - for line in f: - keyvalue = line.split(':') - if keyvalue[0] == label: - values = keyvalue[1].split() - if values[0].isdigit(): - return int(values[0]) - else: - return None - return None - finally: - f.close() + return osdep.lookup_balloon_stat(label) def get_dom0_current_alloc(): """Returns the current memory allocation (in KiB) of dom0."""
tools/python/xen/xend/osdep.py +50 -0
59 lines not on this page · raw message