]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commit
libxc: try to find last used pfn when migrating
authorJuergen Gross <jgross@suse.com>
Wed, 2 Dec 2015 07:42:17 +0000 (08:42 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 8 Dec 2015 16:56:18 +0000 (16:56 +0000)
commit91e204d37f44913913776d0a89279721694f8b32
tree65fb5798d99b7576e68ffa28b26959f51be778d0
parent9ec68500009322fc148742d9aa85596e03c3c2be
libxc: try to find last used pfn when migrating

For migration the last used pfn of a guest is needed to size the
logdirty bitmap and as an upper bound of the page loop. Unfortunately
there are pv-kernels advertising a much higher maximum pfn as they
are really using in order to support memory hotplug. This will lead
to allocation of much more memory in Xen tools during migration as
really needed.

Try to find the last used guest pfn of a pv-domu by scanning the p2m
tree from the last entry towards it's start and search for an entry
not being invalid.

Normally the mid pages of the p2m tree containing all invalid entries
are being reused, so we can just scan the top page for identical
entries and skip them but the first one.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
[ ijc -- added errno = E2BIG to one error path ]
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxc/xc_sr_common.h
tools/libxc/xc_sr_common_x86_pv.c
tools/libxc/xc_sr_save.c
tools/libxc/xc_sr_save_x86_hvm.c
tools/libxc/xc_sr_save_x86_pv.c