[PATCH 08/23] util: alloc: Completely replace VIR_APPEND_ELEMENT_QUIET by VIR_APPEND_ELEMENT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/util/viralloc.h    | 5 -----
 tests/virfilewrapper.c | 4 ++--
 tests/virpcimock.c     | 6 +++---
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/util/viralloc.h b/src/util/viralloc.h
index f02d634eea..3a09af65c5 100644
--- a/src/util/viralloc.h
+++ b/src/util/viralloc.h
@@ -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)
diff --git a/tests/virfilewrapper.c b/tests/virfilewrapper.c
index 3085a190fb..aaff39866d 100644
--- a/tests/virfilewrapper.c
+++ b/tests/virfilewrapper.c
@@ -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);
 }


diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index de39fc65a4..ead810d412 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -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 *
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux