1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00

qemu: qemuBlockGetNamedNodeData: Remove pointless error path

We don't need automatic freeing for 'blockNamedNodeData' and we can
directly return it rather than checking it for NULL-ness first.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-11-09 10:45:27 +01:00
parent 9c26c1bfd4
commit 3fe74ebd90

View File

@ -2610,7 +2610,7 @@ qemuBlockGetNamedNodeData(virDomainObj *vm,
virDomainAsyncJob asyncJob)
{
qemuDomainObjPrivate *priv = vm->privateData;
g_autoptr(GHashTable) blockNamedNodeData = NULL;
GHashTable *blockNamedNodeData = NULL;
bool supports_flat = virQEMUCapsGet(priv->qemuCaps,
QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT);
@ -2621,10 +2621,7 @@ qemuBlockGetNamedNodeData(virDomainObj *vm,
qemuDomainObjExitMonitor(vm);
if (!blockNamedNodeData)
return NULL;
return g_steal_pointer(&blockNamedNodeData);
return blockNamedNodeData;
}