static int
hypervDomainSuspend(virDomainPtr domain)
{
- int result = -1;
hypervPrivate *priv = domain->conn->privateData;
- Msvm_ComputerSystem *computerSystem = NULL;
int requestedState = -1;
switch (priv->wmiVersion) {
break;
}
- if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0)
- goto cleanup;
-
- if (computerSystem->data.common->EnabledState != MSVM_COMPUTERSYSTEM_ENABLEDSTATE_ENABLED) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not active"));
- goto cleanup;
- }
-
- result = hypervInvokeMsvmComputerSystemRequestStateChange(domain, requestedState);
-
- cleanup:
- hypervFreeObject(priv, (hypervObject *)computerSystem);
-
- return result;
+ return hypervRequestStateChange(domain, requestedState);
}