mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
qemu: refactor virQEMUCapsInit
Use g_auto and remove pointless labels. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
This commit is contained in:
parent
c9d6ffacd1
commit
37574d5f17
@ -1111,13 +1111,13 @@ virQEMUCapsProbeHostCPU(virArch hostArch,
|
||||
virCaps *
|
||||
virQEMUCapsInit(virFileCache *cache)
|
||||
{
|
||||
virCaps *caps;
|
||||
g_autoptr(virCaps) caps = NULL;
|
||||
size_t i;
|
||||
virArch hostarch = virArchFromHost();
|
||||
|
||||
if ((caps = virCapabilitiesNew(hostarch,
|
||||
true, true)) == NULL)
|
||||
goto error;
|
||||
return NULL;
|
||||
|
||||
if (virCapabilitiesInitCaches(caps) < 0)
|
||||
VIR_WARN("Failed to get host CPU cache info");
|
||||
@ -1145,13 +1145,9 @@ virQEMUCapsInit(virFileCache *cache)
|
||||
if (virQEMUCapsInitGuest(caps, cache,
|
||||
hostarch,
|
||||
i) < 0)
|
||||
goto error;
|
||||
|
||||
return caps;
|
||||
|
||||
error:
|
||||
virObjectUnref(caps);
|
||||
return NULL;
|
||||
|
||||
return g_steal_pointer(&caps);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user