aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-01 10:16:26 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-01 10:16:26 +0100
commitbb4adad4e121150f2a17cf6b2fdbfc1cbee39f1c (patch)
tree3249217ae95071947432e5ed74049ba7d457c251
parentdc8f50b150be1b7189114cf1305827f8c5b21f0e (diff)
downloadxen-bb4adad4e121150f2a17cf6b2fdbfc1cbee39f1c.tar.gz
xen-bb4adad4e121150f2a17cf6b2fdbfc1cbee39f1c.tar.bz2
xen-bb4adad4e121150f2a17cf6b2fdbfc1cbee39f1c.zip
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>
-rw-r--r--tools/libxc/xc_domain_save.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 49fd25b9b6..32002e0017 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -880,8 +880,17 @@ int xc_domain_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
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 )