From a82ed6a0c38fa853da7f38d2e811db81deeeee1b Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 29 Nov 2011 15:31:19 +0000 Subject: [PATCH] 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 --- src/util/virnodesuspend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 6eb91bc80..7e37118b4 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(); -- 2.39.5