aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Privoznik <mprivozn@redhat.com>2012-08-23 15:26:20 +0200
committerMichal Privoznik <mprivozn@redhat.com>2012-08-23 17:48:44 +0200
commit385ee0e982080d03ce0d11eab32396c0d7057961 (patch)
tree3b23b58e663b8dfcf2748f0c2b17041509c20d65 /src/libvirt.c
parentagent: add qemu-agent-command to virsh (diff)
downloadlibvirt-385ee0e982080d03ce0d11eab32396c0d7057961.tar.gz
libvirt-385ee0e982080d03ce0d11eab32396c0d7057961.tar.bz2
libvirt-385ee0e982080d03ce0d11eab32396c0d7057961.zip
qemu: forbid suspend if already pmsuspended
If a domain is pmsuspended then virsh suspend will succeed. Beside obvious flaw, virsh resume will report success and change domain state to running which is another mistake. Therefore we must forbid any attempts for suspend and resume when pmsuspended.
Diffstat (limited to 'src/libvirt.c')
-rw-r--r--src/libvirt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libvirt.c b/src/libvirt.c
index e0ac391da..b034ed6fe 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2329,6 +2329,8 @@ virDomainRef(virDomainPtr domain)
* hypervisor level will stay allocated. Use virDomainResume() to reactivate
* the domain.
* This function may require privileged access.
+ * Moreover, suspend may not be supported if domain is in some
+ * special state like VIR_DOMAIN_PMSUSPENDED.
*
* Returns 0 in case of success and -1 in case of failure.
*/
@@ -2375,6 +2377,8 @@ error:
* Resume a suspended domain, the process is restarted from the state where
* it was frozen by calling virDomainSuspend().
* This function may require privileged access
+ * Moreover, resume may not be supported if domain is in some
+ * special state like VIR_DOMAIN_PMSUSPENDED.
*
* Returns 0 in case of success and -1 in case of failure.
*/