aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMiroslav Rezanina <mrezanin@redhat.com>2010-09-03 18:22:31 +0100
committerMiroslav Rezanina <mrezanin@redhat.com>2010-09-03 18:22:31 +0100
commit47e13da0a1b0c6e22f95eb79585cb1ab1dddec75 (patch)
tree5637e3d19190bf430de1b8b019613ec7492c9b87 /tools
parentfacd974fa81afda05a03f0c37ec5df12fa514dd5 (diff)
downloadxen-47e13da0a1b0c6e22f95eb79585cb1ab1dddec75.tar.gz
xen-47e13da0a1b0c6e22f95eb79585cb1ab1dddec75.tar.bz2
xen-47e13da0a1b0c6e22f95eb79585cb1ab1dddec75.zip
xend: reserve vtd_mem on guest restore
There's need for free vtd_mem more memory for guest with xen-unstable c/s 17529. This memory is freed when guest is created, but is not freed when guest is restored. So restore guest fails due to not enough of memory for guest. Following patch uses same calculation of memory to free in guest restore as is in guest creation. Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/python/xen/xend/XendCheckpoint.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/python/xen/xend/XendCheckpoint.py b/tools/python/xen/xend/XendCheckpoint.py
index 10ed67f807..4c68fb38af 100644
--- a/tools/python/xen/xend/XendCheckpoint.py
+++ b/tools/python/xen/xend/XendCheckpoint.py
@@ -277,7 +277,15 @@ def restore(xd, fd, dominfo = None, paused = False, relocating = False):
# set memory limit
xc.domain_setmaxmem(dominfo.getDomid(), maxmem)
- balloon.free(memory + shadow, dominfo)
+ vtd_mem = 0
+ info = xc.physinfo()
+ if 'hvm_directio' in info['virt_caps']:
+ # Reserve 1 page per MiB of RAM for separate VT-d page table.
+ vtd_mem = 4 * (dominfo.info['memory_static_max'] / 1024 / 1024)
+ # Round vtd_mem up to a multiple of a MiB.
+ vtd_mem = ((vtd_mem + 1023) / 1024) * 1024
+
+ balloon.free(memory + shadow + vtd_mem, dominfo)
shadow_cur = xc.shadow_mem_control(dominfo.getDomid(), shadow / 1024)
dominfo.info['shadow_memory'] = shadow_cur