]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: alloc: Completely replace VIR_APPEND_ELEMENT_QUIET by VIR_APPEND_ELEMENT
authorPeter Krempa <pkrempa@redhat.com>
Tue, 3 Aug 2021 13:04:55 +0000 (15:04 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 6 Aug 2021 06:53:25 +0000 (08:53 +0200)
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>
src/util/viralloc.h
tests/virfilewrapper.c
tests/virpcimock.c

index f02d634eea2ac849aa386a307e7a2dc7c260f8f4..3a09af65c50c849e89a2a7b2b62e171708df9f88 100644 (file)
@@ -243,11 +243,6 @@ int virDeleteElementsN(void *ptrptr, size_t size, size_t at, size_t *countptr,
                      VIR_TYPEMATCH(ptr, &(newelem)), \
                      &(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:
  * @ptr:   pointer to array of objects (*not* ptr to ptr)
index 3085a190fb98849629c1c4f8e73c5bdfbfc8cdd8..aaff39866d7d8648aa94fc090899768c54125101 100644 (file)
@@ -78,8 +78,8 @@ virFileWrapperAddPrefix(const char *prefix,
 
     init_syms();
 
-    VIR_APPEND_ELEMENT_QUIET(prefixes, nprefixes, prefix);
-    VIR_APPEND_ELEMENT_QUIET(overrides, noverrides, override);
+    VIR_APPEND_ELEMENT(prefixes, nprefixes, prefix);
+    VIR_APPEND_ELEMENT(overrides, noverrides, override);
 }
 
 
index de39fc65a4c84d30b66c80586b1c39fe5b95d845..ead810d412e915b4b86e42321fc2389db03d9875 100644 (file)
@@ -428,7 +428,7 @@ pci_device_create_iommu(const struct pciDevice *dev,
     iommuGroup->iommu = dev->iommuGroup;
     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)
         ABORT("Unable to bind: %s", devid);
 
-    VIR_APPEND_ELEMENT_QUIET(pciDevices, nPCIDevices, dev);
+    VIR_APPEND_ELEMENT(pciDevices, nPCIDevices, dev);
 }
 
 static struct pciDevice *
@@ -713,7 +713,7 @@ pci_driver_new(const char *name, ...)
     make_file(driverpath, "bind", NULL, -1);
     make_file(driverpath, "unbind", NULL, -1);
 
-    VIR_APPEND_ELEMENT_QUIET(pciDrivers, nPCIDrivers, driver);
+    VIR_APPEND_ELEMENT(pciDrivers, nPCIDrivers, driver);
 }
 
 static struct pciDriver *