ia64/xen-unstable

changeset 14989:1cfe47358f9f

save/restore: If ENABLE_LOGDIRTY fails, it may be because it is
already active. To find out, attempt to disable and then reenable the
mode.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
author kfraser@localhost.localdomain
date Tue May 01 10:16:26 2007 +0100 (2007-05-01)
parents 476efa5c9abf
children 26643b7b48b9
files tools/libxc/xc_domain_save.c
line diff
     1.1 --- a/tools/libxc/xc_domain_save.c	Tue May 01 10:15:08 2007 +0100
     1.2 +++ b/tools/libxc/xc_domain_save.c	Tue May 01 10:16:26 2007 +0100
     1.3 @@ -880,8 +880,17 @@ int xc_domain_save(int xc_handle, int io
     1.4                                 XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY,
     1.5                                 NULL, 0, NULL, 0, NULL) < 0 )
     1.6          {
     1.7 -            ERROR("Couldn't enable shadow mode");
     1.8 -            goto out;
     1.9 +            /* log-dirty already enabled? There's no test op,
    1.10 +               so attempt to disable then reenable it */
    1.11 +            if ( !(xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_OFF,
    1.12 +                                     NULL, 0, NULL, 0, NULL) >= 0 &&
    1.13 +                   xc_shadow_control(xc_handle, dom,
    1.14 +                                     XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY,
    1.15 +                                     NULL, 0, NULL, 0, NULL) >= 0) )
    1.16 +            {
    1.17 +                ERROR("Couldn't enable shadow mode");
    1.18 +                goto out;
    1.19 +            }
    1.20          }
    1.21  
    1.22          if ( hvm )