mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-30 12:31:16 +00:00
virDomainPCIAddressSetExtensionAlloc: Remove return value
The function always returns 0. Remove the return value and refactor caller. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
27c39399ff
commit
dd1987268b
@ -962,21 +962,19 @@ virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIds *zpciIds)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static void
|
||||||
virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSet *addrs,
|
virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSet *addrs,
|
||||||
virPCIDeviceAddressExtensionFlags extFlags)
|
virPCIDeviceAddressExtensionFlags extFlags)
|
||||||
{
|
{
|
||||||
if (extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) {
|
if (extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) {
|
||||||
if (addrs->zpciIds)
|
if (addrs->zpciIds)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
addrs->zpciIds = g_new0(virDomainZPCIAddressIds, 1);
|
addrs->zpciIds = g_new0(virDomainZPCIAddressIds, 1);
|
||||||
|
|
||||||
addrs->zpciIds->uids = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, NULL);
|
addrs->zpciIds->uids = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, NULL);
|
||||||
addrs->zpciIds->fids = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, NULL);
|
addrs->zpciIds->fids = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -990,14 +988,9 @@ virDomainPCIAddressSetAlloc(unsigned int nbuses,
|
|||||||
addrs->buses = g_new0(virDomainPCIAddressBus, nbuses);
|
addrs->buses = g_new0(virDomainPCIAddressBus, nbuses);
|
||||||
addrs->nbuses = nbuses;
|
addrs->nbuses = nbuses;
|
||||||
|
|
||||||
if (virDomainPCIAddressSetExtensionAlloc(addrs, extFlags) < 0)
|
virDomainPCIAddressSetExtensionAlloc(addrs, extFlags);
|
||||||
goto error;
|
|
||||||
|
|
||||||
return addrs;
|
return addrs;
|
||||||
|
|
||||||
error:
|
|
||||||
virDomainPCIAddressSetFree(addrs);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user