mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
qemu: refactor virQEMUCapsLoadFile
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
a41b23d718
commit
c9d6ffacd1
@ -5510,7 +5510,7 @@ virQEMUCapsLoadFile(const char *filename,
|
|||||||
void *privData,
|
void *privData,
|
||||||
bool *outdated)
|
bool *outdated)
|
||||||
{
|
{
|
||||||
virQEMUCaps *qemuCaps = virQEMUCapsNewBinary(binary);
|
g_autoptr(virQEMUCaps) qemuCaps = virQEMUCapsNewBinary(binary);
|
||||||
virQEMUCapsCachePriv *priv = privData;
|
virQEMUCapsCachePriv *priv = privData;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -5519,17 +5519,13 @@ virQEMUCapsLoadFile(const char *filename,
|
|||||||
|
|
||||||
ret = virQEMUCapsLoadCache(priv->hostArch, qemuCaps, filename, false);
|
ret = virQEMUCapsLoadCache(priv->hostArch, qemuCaps, filename, false);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto error;
|
return NULL;
|
||||||
if (ret == 1) {
|
if (ret == 1) {
|
||||||
*outdated = true;
|
*outdated = true;
|
||||||
goto error;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return qemuCaps;
|
return g_steal_pointer(&qemuCaps);
|
||||||
|
|
||||||
error:
|
|
||||||
virObjectUnref(qemuCaps);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user