mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByUUID
Signed-off-by: Matt Coleman <matt@datto.com> Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
parent
2ce05af9f2
commit
38560b7efe
@ -1671,18 +1671,15 @@ hypervDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
|
||||
virDomainPtr domain = NULL;
|
||||
hypervPrivate *priv = conn->privateData;
|
||||
char uuid_string[VIR_UUID_STRING_BUFLEN];
|
||||
Msvm_ComputerSystem *computerSystem = NULL;
|
||||
g_autoptr(Msvm_ComputerSystem) computerSystem = NULL;
|
||||
|
||||
virUUIDFormat(uuid, uuid_string);
|
||||
|
||||
if (hypervMsvmComputerSystemFromUUID(priv, uuid_string, &computerSystem) < 0)
|
||||
goto cleanup;
|
||||
return NULL;
|
||||
|
||||
hypervMsvmComputerSystemToDomain(conn, computerSystem, &domain);
|
||||
|
||||
cleanup:
|
||||
hypervFreeObject((hypervObject *)computerSystem);
|
||||
|
||||
return domain;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user