mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
xend: Don't allow dom0 memory to be ballooned below dom0-min-mem
configuration parameter. Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
This commit is contained in:
1 parent
ded4af0862
commit
01d02daa5f
1 file changed
+7
@@ -986,6 +986,13 @@ class XendDomainInfo:
|
||||
self.info['name_label'], str(self.domid), target)
|
||||
|
||||
MiB = 1024 * 1024
|
||||
|
||||
if self.domid == 0:
|
||||
dom0_min_mem = xoptions.get_dom0_min_mem()
|
||||
memory_cur = self.get_memory_dynamic_max() / MiB
|
||||
if target < memory_cur and dom0_min_mem > target:
|
||||
raise XendError("memory_dynamic_max too small")
|
||||
|
||||
self._safe_set_memory('memory_dynamic_min', target * MiB)
|
||||
self._safe_set_memory('memory_dynamic_max', target * MiB)
|
||||
|
||||
|
||||