Enable lazy (on-demand) allocation of memory to a guest being restored; this

means that ballooned down domains only require as much memory as is currently
being used (rather than their max) when being restored from save, or when
being migrated.

Signed-off-by: Steven Hand <steven@xensource.com>
This commit is contained in:
Steven Hand committed 2007-01-16 10:02:50 +00:00
1 parent c5d238206d
commit 236c16423b
2 files changed
+137 -62

No files matched your search

+5 -3
View File
@@ -147,18 +147,20 @@ def restore(xd, fd, dominfo = None, paused = False):
assert store_port
assert console_port
nr_pfns = (dominfo.getMemoryTarget() + 3) / 4
try:
l = read_exact(fd, sizeof_unsigned_long,
"not a valid guest state file: pfn count read")
nr_pfns = unpack("L", l)[0] # native sizeof long
if nr_pfns > 16*1024*1024: # XXX
max_pfn = unpack("L", l)[0] # native sizeof long
if max_pfn > 16*1024*1024: # XXX
raise XendError(
"not a valid guest state file: pfn count out of range")
balloon.free(xc.pages_to_kib(nr_pfns))
cmd = map(str, [xen.util.auxbin.pathTo(XC_RESTORE),
fd, dominfo.getDomid(), nr_pfns,
fd, dominfo.getDomid(), max_pfn,
store_port, console_port])
log.debug("[xc_restore]: %s", string.join(cmd))
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.