summaryrefslogtreecommitdiffstats
path: root/func/patches/0002-Adding-freemem-functionality.patch
diff options
context:
space:
mode:
authorMatthew Hicks <mhicks@mhicks-host.usersys.redhat.com>2008-06-18 10:00:16 -0400
committerMatthew Hicks <mhicks@mhicks-host.usersys.redhat.com>2008-06-18 10:00:16 -0400
commit5f299e05bdeac6dc086065b9c5ff68d7c25eec16 (patch)
tree461f3ce84cb651e46eac196d6cce40ff1d0065c1 /func/patches/0002-Adding-freemem-functionality.patch
parent14dd22a0644bf4ea4a7f5f2e6f5b08fe793eb943 (diff)
Moving all the func changes to a public repo and changing the
README to reference that until those changes are upstream
Diffstat (limited to 'func/patches/0002-Adding-freemem-functionality.patch')
-rw-r--r--func/patches/0002-Adding-freemem-functionality.patch43
1 files changed, 0 insertions, 43 deletions
diff --git a/func/patches/0002-Adding-freemem-functionality.patch b/func/patches/0002-Adding-freemem-functionality.patch
deleted file mode 100644
index 15938d2..0000000
--- a/func/patches/0002-Adding-freemem-functionality.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 4cec34948da30acfb6d0724019f12db596807ce2 Mon Sep 17 00:00:00 2001
-From: Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com>
-Date: Tue, 17 Jun 2008 19:56:18 -0400
-Subject: [PATCH] Adding freemem functionality
- - Calculates the amount of memory available to virtual
- machines assuming Domain-0 can be reduced to 256M
-
----
- func/minion/modules/virt.py | 18 ++++++++++++++++++
- 1 files changed, 18 insertions(+), 0 deletions(-)
-
-diff --git a/func/minion/modules/virt.py b/func/minion/modules/virt.py
-index 92107fe..40ae274 100644
---- a/func/minion/modules/virt.py
-+++ b/func/minion/modules/virt.py
-@@ -184,6 +184,24 @@ class Virt(func_module.FuncModule):
- pass
- return results
-
-+ def freemem(self):
-+ self.conn = self.__get_conn()
-+ # Start with the physical memory and subtract
-+ memory = self.conn.nodeinfo()[1]
-+
-+ # Take 256M off which is reserved for Domain-0
-+ memory = memory - 256
-+
-+ vms = self.conn.find_vm(-1)
-+ for vm in vms:
-+ # Exclude stopped vms and Domain-0 by using
-+ # ids greater than 0
-+ if vm.ID() > 0:
-+ # This node is active - remove its memory (in bytes)
-+ memory = memory - int(vm.info()[2])/1024
-+
-+ return memory
-+
- def install(self, server_name, target_name, system=False, virt_name=None, virt_path=None):
-
- """
---
-1.5.3.6
-