ia64/xen-unstable

changeset 15926:b594583d6e44

Log an error when enabling shadow mode fails for live relocation.
Signed-off-by: Doug Merrill <dpmerrill@novell.com>
author kfraser@localhost.localdomain
date Tue Sep 18 15:11:39 2007 +0100 (2007-09-18)
parents f19c741cb55f
children b7eb2bb9b625
files tools/libxc/xc_domain_save.c
line diff
     1.1 --- a/tools/libxc/xc_domain_save.c	Tue Sep 18 15:09:57 2007 +0100
     1.2 +++ b/tools/libxc/xc_domain_save.c	Tue Sep 18 15:11:39 2007 +0100
     1.3 @@ -789,7 +789,7 @@ int xc_domain_save(int xc_handle, int io
     1.4  {
     1.5      xc_dominfo_t info;
     1.6  
     1.7 -    int rc = 1, i, j, last_iter, iter = 0;
     1.8 +    int rc = 1, frc, i, j, last_iter, iter = 0;
     1.9      int live  = (flags & XCFLAGS_LIVE);
    1.10      int debug = (flags & XCFLAGS_DEBUG);
    1.11      int race = 0, sent_last_iter, skip_this_iter;
    1.12 @@ -882,13 +882,18 @@ int xc_domain_save(int xc_handle, int io
    1.13          {
    1.14              /* log-dirty already enabled? There's no test op,
    1.15                 so attempt to disable then reenable it */
    1.16 -            if ( !(xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_OFF,
    1.17 -                                     NULL, 0, NULL, 0, NULL) >= 0 &&
    1.18 -                   xc_shadow_control(xc_handle, dom,
    1.19 -                                     XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY,
    1.20 -                                     NULL, 0, NULL, 0, NULL) >= 0) )
    1.21 +            frc = xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_OFF,
    1.22 +                                    NULL, 0, NULL, 0, NULL);
    1.23 +            if ( frc >= 0 )
    1.24              {
    1.25 -                ERROR("Couldn't enable shadow mode");
    1.26 +                frc = xc_shadow_control(xc_handle, dom,
    1.27 +                                        XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY,
    1.28 +                                        NULL, 0, NULL, 0, NULL);
    1.29 +            }
    1.30 +            
    1.31 +            if ( frc < 0 )
    1.32 +            {
    1.33 +                ERROR("Couldn't enable shadow mode (rc %d) (errno %d)", frc, errno );
    1.34                  goto out;
    1.35              }
    1.36          }