From 2e2fb7958b1bb2f9a503804251ce8907c730440d Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@google.com>
Date: Thu, 8 Dec 2011 17:08:48 +0000
Subject: [PATCH] No-op memory ballooning in chroot and lxc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently they have no memory limits set.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 lib/hypervisor/hv_chroot.py | 12 ++++++++++++
 lib/hypervisor/hv_lxc.py    | 12 ++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/lib/hypervisor/hv_chroot.py b/lib/hypervisor/hv_chroot.py
index 8b6ae8a61..3830f5f6b 100644
--- a/lib/hypervisor/hv_chroot.py
+++ b/lib/hypervisor/hv_chroot.py
@@ -233,6 +233,18 @@ class ChrootManager(hv_base.BaseHypervisor):
     raise HypervisorError("The chroot manager doesn't implement the"
                           " reboot functionality")
 
+  def BalloonInstanceMemory(self, instance, mem):
+    """Balloon an instance memory to a certain value.
+
+    @type instance: L{objects.Instance}
+    @param instance: instance to be accepted
+    @type mem: int
+    @param mem: actual memory size to use for instance runtime
+
+    """
+    # Currently chroots don't have memory limits
+    pass
+
   def GetNodeInfo(self):
     """Return information about the node.
 
diff --git a/lib/hypervisor/hv_lxc.py b/lib/hypervisor/hv_lxc.py
index ce9e55a43..70e738462 100644
--- a/lib/hypervisor/hv_lxc.py
+++ b/lib/hypervisor/hv_lxc.py
@@ -361,6 +361,18 @@ class LXCHypervisor(hv_base.BaseHypervisor):
     raise HypervisorError("The LXC hypervisor doesn't implement the"
                           " reboot functionality")
 
+  def BalloonInstanceMemory(self, instance, mem):
+    """Balloon an instance memory to a certain value.
+
+    @type instance: L{objects.Instance}
+    @param instance: instance to be accepted
+    @type mem: int
+    @param mem: actual memory size to use for instance runtime
+
+    """
+    # Currently lxc instances don't have memory limits
+    pass
+
   def GetNodeInfo(self):
     """Return information about the node.
 
-- 
GitLab