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
This commit is contained in:
Daniel P. Berrange 2011-11-29 15:31:19 +00:00
parent 9ae0b8349c
commit a82ed6a0c3

View File

@ -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();