/* Quiet version of macros above */
#define VIR_APPEND_ELEMENT_QUIET(ptr, count, newelem) \
- VIR_APPEND_ELEMENT(ptr, count, newelem)
+ virAppendElement(&(ptr), sizeof(*(ptr)), &(count), \
+ VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, false)
/**
* VIR_DELETE_ELEMENT:
init_syms();
- if (VIR_APPEND_ELEMENT_QUIET(prefixes, nprefixes, prefix) < 0 ||
- VIR_APPEND_ELEMENT_QUIET(overrides, noverrides, override) < 0) {
- VIR_FREE(prefixes);
- VIR_FREE(overrides);
- fprintf(stderr, "Unable to add path override for '%s'\n", prefix);
- abort();
- }
+ VIR_APPEND_ELEMENT_QUIET(prefixes, nprefixes, prefix);
+ VIR_APPEND_ELEMENT_QUIET(overrides, noverrides, override);
}
iommuGroup->iommu = dev->iommuGroup;
iommuGroup->nDevicesBoundToVFIO = 0; /* No device bound to VFIO by default */
- if (VIR_APPEND_ELEMENT_QUIET(pciIommuGroups, npciIommuGroups,
- iommuGroup) < 0)
- ABORT_OOM();
+ VIR_APPEND_ELEMENT_QUIET(pciIommuGroups, npciIommuGroups, iommuGroup);
}
if (pci_device_autobind(dev) < 0)
ABORT("Unable to bind: %s", devid);
- if (VIR_APPEND_ELEMENT_QUIET(pciDevices, nPCIDevices, dev) < 0)
- ABORT_OOM();
+ VIR_APPEND_ELEMENT_QUIET(pciDevices, nPCIDevices, dev);
}
static struct pciDevice *
make_file(driverpath, "bind", NULL, -1);
make_file(driverpath, "unbind", NULL, -1);
- if (VIR_APPEND_ELEMENT_QUIET(pciDrivers, nPCIDrivers, driver) < 0)
- ABORT_OOM();
+ VIR_APPEND_ELEMENT_QUIET(pciDrivers, nPCIDrivers, driver);
}
static struct pciDriver *