mirror of https://gitee.com/openkylin/libvirt.git
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainIsActive
Signed-off-by: Matt Coleman <matt@datto.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
5997e1e218
commit
acb9273074
src/hyperv
|
@ -2770,18 +2770,12 @@ hypervConnectIsAlive(virConnectPtr conn)
|
|||
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;
|
||||
return -1;
|
||||
|
||||
result = hypervIsMsvmComputerSystemActive(computerSystem, NULL) ? 1 : 0;
|
||||
|
||||
cleanup:
|
||||
hypervFreeObject((hypervObject *)computerSystem);
|
||||
|
||||
return result;
|
||||
return hypervIsMsvmComputerSystemActive(computerSystem, NULL) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue