* 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.
*/
* 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.
*/
qemuDomainObjPrivatePtr priv;
virDomainPausedReason reason;
int eventDetail;
+ int state;
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
"%s", _("domain is not running"));
goto endjob;
}
- if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_PAUSED) {
+
+ state = virDomainObjGetState(vm, NULL);
+ if (state == VIR_DOMAIN_PMSUSPENDED) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is pmsuspended"));
+ goto endjob;
+ } else if (state != VIR_DOMAIN_PAUSED) {
if (qemuProcessStopCPUs(driver, vm, reason, QEMU_ASYNC_JOB_NONE) < 0) {
goto endjob;
}
virDomainObjPtr vm;
int ret = -1;
virDomainEventPtr event = NULL;
+ int state;
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
"%s", _("domain is not running"));
goto endjob;
}
- if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
+
+ state = virDomainObjGetState(vm, NULL);
+ if (state == VIR_DOMAIN_PMSUSPENDED) {
+ virReportError(VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is pmsuspended"));
+ goto endjob;
+ } else if (state == VIR_DOMAIN_PAUSED) {
if (qemuProcessStartCPUs(driver, vm, dom->conn,
VIR_DOMAIN_RUNNING_UNPAUSED,
QEMU_ASYNC_JOB_NONE) < 0) {