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