Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
static int
hypervDomainIsActive(virDomainPtr domain)
{
- int result = -1;
- Msvm_ComputerSystem *computerSystem = NULL;
+ g_autoptr(Msvm_ComputerSystem) computerSystem = NULL;
if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0)
- goto cleanup;
-
- result = hypervIsMsvmComputerSystemActive(computerSystem, NULL) ? 1 : 0;
-
- cleanup:
- hypervFreeObject((hypervObject *)computerSystem);
+ return -1;
- return result;
+ return hypervIsMsvmComputerSystemActive(computerSystem, NULL) ? 1 : 0;
}