util: alloc: Completely replace VIR_APPEND_ELEMENT_QUIET by VIR_APPEND_ELEMENT

VIR_APPEND_ELEMENT doesn't report any errors now so we can remove
VIR_APPEND_ELEMENT_QUIET and replace all uses by VIR_APPEND_ELEMENT

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2021-08-03 15:04:55 +02:00
parent 98f6f2081d
commit f90de01763
3 changed files with 5 additions and 10 deletions

View File

@ -243,11 +243,6 @@ int virDeleteElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
VIR_TYPEMATCH(ptr, &(newelem)), \ VIR_TYPEMATCH(ptr, &(newelem)), \
&(newelem), false, true) &(newelem), false, true)
/* Quiet version of macros above */
#define VIR_APPEND_ELEMENT_QUIET(ptr, count, newelem) \
virAppendElement(&(ptr), sizeof(*(ptr)), &(count), \
VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, false)
/** /**
* VIR_DELETE_ELEMENT: * VIR_DELETE_ELEMENT:
* @ptr: pointer to array of objects (*not* ptr to ptr) * @ptr: pointer to array of objects (*not* ptr to ptr)

View File

@ -78,8 +78,8 @@ virFileWrapperAddPrefix(const char *prefix,
init_syms(); init_syms();
VIR_APPEND_ELEMENT_QUIET(prefixes, nprefixes, prefix); VIR_APPEND_ELEMENT(prefixes, nprefixes, prefix);
VIR_APPEND_ELEMENT_QUIET(overrides, noverrides, override); VIR_APPEND_ELEMENT(overrides, noverrides, override);
} }

View File

@ -428,7 +428,7 @@ pci_device_create_iommu(const struct pciDevice *dev,
iommuGroup->iommu = dev->iommuGroup; iommuGroup->iommu = dev->iommuGroup;
iommuGroup->nDevicesBoundToVFIO = 0; /* No device bound to VFIO by default */ iommuGroup->nDevicesBoundToVFIO = 0; /* No device bound to VFIO by default */
VIR_APPEND_ELEMENT_QUIET(pciIommuGroups, npciIommuGroups, iommuGroup); VIR_APPEND_ELEMENT(pciIommuGroups, npciIommuGroups, iommuGroup);
} }
@ -542,7 +542,7 @@ pci_device_new_from_stub(const struct pciDevice *data)
if (pci_device_autobind(dev) < 0) if (pci_device_autobind(dev) < 0)
ABORT("Unable to bind: %s", devid); ABORT("Unable to bind: %s", devid);
VIR_APPEND_ELEMENT_QUIET(pciDevices, nPCIDevices, dev); VIR_APPEND_ELEMENT(pciDevices, nPCIDevices, dev);
} }
static struct pciDevice * static struct pciDevice *
@ -713,7 +713,7 @@ pci_driver_new(const char *name, ...)
make_file(driverpath, "bind", NULL, -1); make_file(driverpath, "bind", NULL, -1);
make_file(driverpath, "unbind", NULL, -1); make_file(driverpath, "unbind", NULL, -1);
VIR_APPEND_ELEMENT_QUIET(pciDrivers, nPCIDrivers, driver); VIR_APPEND_ELEMENT(pciDrivers, nPCIDrivers, driver);
} }
static struct pciDriver * static struct pciDriver *