1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainHasManagedSaveImage

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Matt Coleman 2021-01-21 13:51:19 -05:00 committed by Laine Stump
parent 92853b9025
commit 54d96d7fde

View File

@ -2829,20 +2829,14 @@ hypervDomainManagedSave(virDomainPtr domain, unsigned int flags)
static int
hypervDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags)
{
int result = -1;
Msvm_ComputerSystem *computerSystem = NULL;
g_autoptr(Msvm_ComputerSystem) computerSystem = NULL;
virCheckFlags(0, -1);
if (hypervMsvmComputerSystemFromDomain(domain, &computerSystem) < 0)
goto cleanup;
return -1;
result = computerSystem->data->EnabledState == MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED ? 1 : 0;
cleanup:
hypervFreeObject((hypervObject *)computerSystem);
return result;
return computerSystem->data->EnabledState == MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED ? 1 : 0;
}