ia64/xen-unstable

changeset 18536:f4552d9f6afb

hvm, save/restore: Skip page batches which contain no valid pages.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Sep 23 17:11:33 2008 +0100 (2008-09-23)
parents fd3f54eb23e1
children c6f80d1227cb
files tools/libxc/xc_domain_save.c
line diff
     1.1 --- a/tools/libxc/xc_domain_save.c	Tue Sep 23 12:30:42 2008 +0100
     1.2 +++ b/tools/libxc/xc_domain_save.c	Tue Sep 23 17:11:33 2008 +0100
     1.3 @@ -1115,7 +1115,20 @@ int xc_domain_save(int xc_handle, int io
     1.4                  goto out;
     1.5              }
     1.6  
     1.7 -            if ( !hvm )
     1.8 +            if ( hvm )
     1.9 +            {
    1.10 +                /* Look for and skip completely empty batches. */
    1.11 +                for ( j = 0; j < batch; j++ )
    1.12 +                    if ( (pfn_type[j] & XEN_DOMCTL_PFINFO_LTAB_MASK) !=
    1.13 +                         XEN_DOMCTL_PFINFO_XTAB )
    1.14 +                        break;
    1.15 +                if ( j == batch )
    1.16 +                {
    1.17 +                    munmap(region_base, batch*PAGE_SIZE);
    1.18 +                    continue; /* bail on this batch: no valid pages */
    1.19 +                }
    1.20 +            }
    1.21 +            else
    1.22              {
    1.23                  /* Get page types */
    1.24                  for ( j = 0; j < batch; j++ )