Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/qemu/qemu_domain.c | 4 ++-- src/qemu/qemu_process.c | 2 +- src/util/viralloc.h | 15 --------------- src/util/virfile.c | 2 +- tests/virpcimock.c | 6 +++--- tools/vsh.c | 2 +- 6 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0ed132a829..9719636a2a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -511,7 +511,7 @@ qemuDomainMasterKeyReadFile(qemuDomainObjPrivatePtr priv) goto error; } - ignore_value(VIR_REALLOC_N_QUIET(masterKey, masterKeyLen)); + ignore_value(VIR_REALLOC_N(masterKey, masterKeyLen)); priv->masterKey = masterKey; priv->masterKeyLen = masterKeyLen; @@ -6357,7 +6357,7 @@ ssize_t qemuDomainLogContextRead(qemuDomainLogContextPtr ctxt, buf[got] = '\0'; - ignore_value(VIR_REALLOC_N_QUIET(buf, got + 1)); + ignore_value(VIR_REALLOC_N(buf, got + 1)); buflen = got; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index dd60fb0ddf..42a5d3ce19 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2082,7 +2082,7 @@ qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, got -= skip; } - ignore_value(VIR_REALLOC_N_QUIET(buf, got + 1)); + ignore_value(VIR_REALLOC_N(buf, got + 1)); *msg = buf; return 0; } diff --git a/src/util/viralloc.h b/src/util/viralloc.h index c60148724d..a50cd5d632 100644 --- a/src/util/viralloc.h +++ b/src/util/viralloc.h @@ -105,21 +105,6 @@ void virDisposeString(char **strptr) */ #define VIR_REALLOC_N(ptr, count) virReallocN(&(ptr), sizeof(*(ptr)), (count)) -/** - * VIR_REALLOC_N_QUIET: - * @ptr: pointer to hold address of allocated memory - * @count: number of elements to allocate - * - * Re-allocate an array of 'count' elements, each sizeof(*ptr) - * bytes long and store the address of allocated memory in - * 'ptr'. If 'ptr' grew, the added memory is uninitialized. - * - * This macro is safe to use on arguments with side effects. - * - * Returns 0 on success, aborts on OOM - */ -#define VIR_REALLOC_N_QUIET(ptr, count) VIR_REALLOC_N(ptr, count) - /** * VIR_EXPAND_N: * @ptr: pointer to hold address of allocated memory diff --git a/src/util/virfile.c b/src/util/virfile.c index 90156845df..716ffdf7b6 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -4339,7 +4339,7 @@ virFileGetXAttrQuiet(const char *path, if ((need = getxattr(path, name, NULL, 0)) < 0) goto cleanup; - if (VIR_REALLOC_N_QUIET(buf, need + 1) < 0) + if (VIR_REALLOC_N(buf, need + 1) < 0) goto cleanup; if ((got = getxattr(path, name, buf, need)) < 0) { diff --git a/tests/virpcimock.c b/tests/virpcimock.c index 76818d0031..30a31cb5de 100644 --- a/tests/virpcimock.c +++ b/tests/virpcimock.c @@ -305,7 +305,7 @@ add_fd(int fd, const char *path) fd, path, cb.fd, cb.path); } - if (VIR_REALLOC_N_QUIET(callbacks, nCallbacks + 1) < 0) { + if (VIR_REALLOC_N(callbacks, nCallbacks + 1) < 0) { errno = ENOMEM; return -1; } @@ -709,8 +709,8 @@ pci_driver_new(const char *name, ...) if ((device = va_arg(args, int)) == -1) ABORT("Invalid vendor device pair for driver %s", name); - if (VIR_REALLOC_N_QUIET(driver->vendor, driver->len + 1) < 0 || - VIR_REALLOC_N_QUIET(driver->device, driver->len + 1) < 0) + if (VIR_REALLOC_N(driver->vendor, driver->len + 1) < 0 || + VIR_REALLOC_N(driver->device, driver->len + 1) < 0) ABORT_OOM(); driver->vendor[driver->len] = vendor; diff --git a/tools/vsh.c b/tools/vsh.c index 0e8edcd78c..345458a0e2 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2723,7 +2723,7 @@ vshCompleterFilter(char ***list, newList_len++; } - ignore_value(VIR_REALLOC_N_QUIET(newList, newList_len + 1)); + ignore_value(VIR_REALLOC_N(newList, newList_len + 1)); VIR_FREE(*list); *list = newList; return 0; -- 2.26.2