aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-09-23 17:11:33 +0100
committerKeir Fraser <keir.fraser@citrix.com>2008-09-23 17:11:33 +0100
commitc2c102907073dbdd468e72e58dd4bc855a404e65 (patch)
tree83c285f280acbcc470fb1106988b7ce8226b5124 /tools/libxc
parent0e7c1355bc8892881dd51be14c9a3b50051569c4 (diff)
downloadxen-c2c102907073dbdd468e72e58dd4bc855a404e65.tar.gz
xen-c2c102907073dbdd468e72e58dd4bc855a404e65.tar.bz2
xen-c2c102907073dbdd468e72e58dd4bc855a404e65.zip
hvm, save/restore: Skip page batches which contain no valid pages.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'tools/libxc')
-rw-r--r--tools/libxc/xc_domain_save.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index c6e1c23c32..c1ced27d98 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1115,7 +1115,20 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
goto out;
}
- if ( !hvm )
+ if ( hvm )
+ {
+ /* Look for and skip completely empty batches. */
+ for ( j = 0; j < batch; j++ )
+ if ( (pfn_type[j] & XEN_DOMCTL_PFINFO_LTAB_MASK) !=
+ XEN_DOMCTL_PFINFO_XTAB )
+ break;
+ if ( j == batch )
+ {
+ munmap(region_base, batch*PAGE_SIZE);
+ continue; /* bail on this batch: no valid pages */
+ }
+ }
+ else
{
/* Get page types */
for ( j = 0; j < batch; j++ )