[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 89/99] replace functions which are only available in
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 89/99] replace functions which are only available in glib-2.24 |
Date: |
Mon, 23 Jul 2018 15:17:38 -0500 |
From: Olaf Hering <address@hidden>
Currently the minimal supported version of glib is 2.22.
Since testing is done with a glib that claims to be 2.22, but in fact
has APIs from newer version of glib, this bug was not caught during
submit of the patch referenced below.
Replace g_realloc_n, which is available only since 2.24, with g_renew.
Fixes commit 418026ca43 ("util: Introduce vfio helpers")
Signed-off-by: Olaf Hering <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
CC: address@hidden
(cherry picked from commit d29eb678bcfbb2fbf4b79423797253ee02f5c6cf)
Signed-off-by: Michael Roth <address@hidden>
---
util/vfio-helpers.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c
index 006674c916..1d9272efa4 100644
--- a/util/vfio-helpers.c
+++ b/util/vfio-helpers.c
@@ -522,8 +522,7 @@ static IOVAMapping *qemu_vfio_add_mapping(QEMUVFIOState *s,
assert(index >= 0);
s->nr_mappings++;
- s->mappings = g_realloc_n(s->mappings, sizeof(s->mappings[0]),
- s->nr_mappings);
+ s->mappings = g_renew(IOVAMapping, s->mappings, s->nr_mappings);
insert = &s->mappings[index];
shift = s->nr_mappings - index - 1;
if (shift) {
@@ -577,8 +576,7 @@ static void qemu_vfio_undo_mapping(QEMUVFIOState *s,
IOVAMapping *mapping,
memmove(mapping, &s->mappings[index + 1],
sizeof(s->mappings[0]) * (s->nr_mappings - index - 1));
s->nr_mappings--;
- s->mappings = g_realloc_n(s->mappings, sizeof(s->mappings[0]),
- s->nr_mappings);
+ s->mappings = g_renew(IOVAMapping, s->mappings, s->nr_mappings);
}
/* Check if the mapping list is (ascending) ordered. */
--
2.17.1
- [Qemu-devel] [PATCH 79/99] target/arm: Introduce and use read_fp_hreg, (continued)
- [Qemu-devel] [PATCH 79/99] target/arm: Introduce and use read_fp_hreg, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 07/99] target/arm: Implement v8M VLLDM and VLSTM, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 81/99] target/arm: Implement FP data-processing (3 source) for fp16, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 84/99] target/arm: Implement FMOV (immediate) for fp16, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 83/99] target/arm: Implement FCSEL for fp16, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 82/99] target/arm: Implement FCMP for fp16, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 85/99] target/arm: Fix sqrt_f16 exception raising, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 86/99] hw/isa/superio: Fix inconsistent use of Chardev->be, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 87/99] mux: fix ctrl-a b again, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 88/99] nfs: Remove processed options from QDict, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 89/99] replace functions which are only available in glib-2.24,
Michael Roth <=
- [Qemu-devel] [PATCH 90/99] vfio/pci: Default display option to "off", Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 91/99] migration/block-dirty-bitmap: fix dirty_bitmap_load, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 08/99] target/ppc: always set PPC_MEM_TLBIE in pre 2.8 migration hack, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 92/99] tcg: Reduce max TB opcode count, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 94/99] iscsi: Avoid potential for get_status overflow, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 93/99] nbd/server: Reject 0-length block status request, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 95/99] virtio-rng: process pending requests on DRIVER_OK, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 96/99] target/ppc: set is_jmp on ppc_tr_breakpoint_check, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 97/99] tap: fix memory leak on success to create a tap device, Michael Roth, 2018/07/23
- [Qemu-devel] [PATCH 98/99] qemu-img: avoid overflow of min_sparse parameter, Michael Roth, 2018/07/23