From: Daniel P. Berrange Date: Tue, 29 Nov 2011 15:31:19 +0000 (+0000) Subject: Don't mark suspend as active until we know it is running X-Git-Tag: v0.9.8-rc1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a82ed6a0c38fa853da7f38d2e811db81deeeee1b;p=thirdparty%2Flibvirt.git Don't mark suspend as active until we know it is running If suspend failed for some reason (e.g. too short duration) then subsequent attempts to trigger suspend were rejected because we had already marked a suspend as being in progress * src/util/virnodesuspend.c: Don't mark suspend as active until we've successfully triggered it --- diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 6eb91bc80f..7e37118b49 100644 --- a/src/util/virnodesuspend.c +++ b/src/util/virnodesuspend.c @@ -202,7 +202,6 @@ int nodeSuspendForDuration(virConnectPtr conn ATTRIBUTE_UNUSED, _("Suspend operation already in progress")); goto cleanup; } - aboutToSuspend = true; /* Check if the host supports the requested suspend target */ switch (target) { @@ -245,6 +244,7 @@ int nodeSuspendForDuration(virConnectPtr conn ATTRIBUTE_UNUSED, goto cleanup; } + aboutToSuspend = true; ret = 0; cleanup: virNodeSuspendUnlock();