static int
hypervDomainResume(virDomainPtr domain)
{
- int result = -1;
- Msvm_ComputerSystem *computerSystem = NULL;
+ g_autoptr(Msvm_ComputerSystem) computerSystem = NULL;
if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0)
return -1;
if (computerSystem->data->EnabledState != MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_QUIESCE) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain is not paused"));
- goto cleanup;
+ return -1;
}
- result = hypervInvokeMsvmComputerSystemRequestStateChange(domain,
- MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_ENABLED);
-
- cleanup:
- hypervFreeObject((hypervObject *)computerSystem);
-
- return result;
+ return hypervInvokeMsvmComputerSystemRequestStateChange(domain,
+ MSVM_COMPUTERSYSTEM_REQUESTEDSTATE_ENABLED);
}