# HG changeset patch # User Brendan Cully # Date 1177973594 25200 # Node ID ab6f47595b9c39fa1b68372daeb0a88c0f1da43c # Parent 0f9b97523450aae06d42852bdac9bbca3d6033d1 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 diff -r 0f9b97523450 -r ab6f47595b9c tools/libxc/xc_domain_save.c --- a/tools/libxc/xc_domain_save.c Sat Apr 28 09:44:24 2007 +0100 +++ b/tools/libxc/xc_domain_save.c Mon Apr 30 15:53:14 2007 -0700 @@ -880,8 +880,17 @@ int xc_domain_save(int xc_handle, int io XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY, NULL, 0, NULL, 0, NULL) < 0 ) { - ERROR("Couldn't enable shadow mode"); - goto out; + /* log-dirty already enabled? There's no test op, + so attempt to disable then reenable it */ + if ( !(xc_shadow_control(xc_handle, dom, XEN_DOMCTL_SHADOW_OP_OFF, + NULL, 0, NULL, 0, NULL) >= 0 && + xc_shadow_control(xc_handle, dom, + XEN_DOMCTL_SHADOW_OP_ENABLE_LOGDIRTY, + NULL, 0, NULL, 0, NULL) >= 0) ) + { + ERROR("Couldn't enable shadow mode"); + goto out; + } } if ( hvm )