* [Qemu-devel] [PULL v2 00/25] Misc QEMU fixes for 2016-08-02
@ 2016-08-03 17:04 Paolo Bonzini
2016-08-03 17:04 ` [Qemu-devel] [PULL 11/25] qdist: use g_renew and g_new instead of g_realloc and g_malloc Paolo Bonzini
2016-08-04 10:19 ` [Qemu-devel] [PULL v2 00/25] Misc QEMU fixes for 2016-08-02 Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-08-03 17:04 UTC (permalink / raw)
To: qemu-devel
The following changes since commit cc0100f464c94bf80ad36cd432f4a1ed58126b60:
MAINTAINERS: Update the Xilinx maintainers (2016-08-01 15:31:32 +0100)
are available in the git repository at:
git://github.com/bonzini/qemu.git tags/for-upstream
for you to fetch changes up to e911765cbb9e9ddf5d952c88bb52180a62c6cea0:
util: Fix assertion in iov_copy() upon zero 'bytes' and non-zero 'offset' (2016-08-03 18:44:57 +0200)
----------------------------------------------------------------
* xsetbv fix (x86 targets TCG)
* remove unused functions
* qht segfault and memory leak fixes
* NBD fixes
* Fix for non-power-of-2 discard granularity
* Memory hotplug fixes
* Migration regressions
* IOAPIC fixes and (disabled by default) EOI register support
* Various other small fixes
----------------------------------------------------------------
Cao jin (3):
util: drop inet_nonblocking_connect()
util: drop unix_nonblocking_connect()
util: Drop inet_listen()
Dave Hansen (1):
target-i386: fix typo in xsetbv implementation
Emilio G. Cota (4):
qht: do not segfault when gathering stats from an uninitialized qht
qdist: fix memory leak during binning
qdist: use g_renew and g_new instead of g_realloc and g_malloc.
qdist: return "(empty)" instead of NULL when printing an empty dist
Eric Blake (4):
nbd: Fix bad flag detection on server
nbd: Limit nbdflags to 16 bits
osdep: Document differences in rounding macros
block: Cater to iscsi with non-power-of-2 discard
Fam Zheng (1):
qdev: Fix use after free in qdev_init_nofail error path
Greg Kurz (1):
numa: set the memory backend "is_mapped" field
Igor Mammedov (3):
fix qemu exit on memory hotplug when allocation fails at prealloc time
i2c: fix migration regression introduced by broadcast support
apic: fix broken migration for kvm-apic
Markus Armbruster (1):
fw_cfg: Make base type "fw_cfg" abstract
Paolo Bonzini (3):
util/qht: Document memory ordering assumptions
checkpatch: add check for bzero
mptsas: really fix migration compatibility
Peter Xu (2):
x86: ioapic: ignore level irq during processing
x86: ioapic: add support for explicit EOI
Robert Ho (1):
Reorganize help output of '-display' option
Shmulik Ladkani (1):
util: Fix assertion in iov_copy() upon zero 'bytes' and non-zero 'offset'
backends/hostmem.c | 18 +++++++---
block/io.c | 15 ++++----
block/nbd-client.h | 2 +-
exec.c | 10 ++++--
hw/core/qdev.c | 2 ++
hw/i2c/core.c | 10 ++++--
hw/intc/ioapic.c | 36 +++++++++++++++----
hw/nvram/fw_cfg.c | 1 +
hw/scsi/mptsas.c | 4 ++-
hw/scsi/mptsas.h | 2 ++
include/block/block_int.h | 37 +++++++++++---------
include/block/nbd.h | 6 ++--
include/hw/i386/ioapic_internal.h | 4 +--
include/hw/i386/pc.h | 2 +-
include/qemu/osdep.h | 8 +++--
include/qemu/qht.h | 5 +++
include/qemu/sockets.h | 8 -----
nbd/client.c | 28 ++++++++-------
nbd/server.c | 13 ++++---
numa.c | 1 +
qemu-nbd.c | 4 +--
qemu-options.hx | 29 +++++++++++----
scripts/checkpatch.pl | 5 ++-
target-i386/translate.c | 2 +-
tests/test-qdist.c | 10 ++++--
tests/test-qht.c | 4 +++
translate-all.c | 70 ++++++++++++++++++++----------------
util/iov.c | 3 +-
util/oslib-posix.c | 26 +++++++-------
util/oslib-win32.c | 2 +-
util/qdist.c | 13 +++----
util/qemu-sockets.c | 74 ---------------------------------------
util/qht.c | 14 ++++++--
33 files changed, 251 insertions(+), 217 deletions(-)
--
2.7.4
diff --git a/util/qdist.c b/util/qdist.c
index 41eff08..5f75e24 100644
--- a/util/qdist.c
+++ b/util/qdist.c
@@ -18,7 +18,7 @@
void qdist_init(struct qdist *dist)
{
- dist->entries = g_malloc(sizeof(*dist->entries));
+ dist->entries = g_new(struct qdist_entry, 1);
dist->size = 1;
dist->n = 0;
}
@@ -64,8 +64,7 @@ void qdist_add(struct qdist *dist, double x, long count)
if (unlikely(dist->n == dist->size)) {
dist->size *= 2;
- dist->entries = g_realloc_n(dist->entries, dist->size,
- sizeof(*dist->entries));
+ dist->entries = g_renew(struct qdist_entry, dist->entries, dist->size);
}
dist->n++;
entry = &dist->entries[dist->n - 1];
@@ -190,7 +189,7 @@ void qdist_bin__internal(struct qdist *to, const struct qdist *from, size_t n)
}
}
/* they're equally spaced, so copy the dist and bail out */
- to->entries = g_realloc_n(to->entries, n, sizeof(*to->entries));
+ to->entries = g_renew(struct qdist_entry, to->entries, n);
to->n = from->n;
memcpy(to->entries, from->entries, sizeof(*to->entries) * to->n);
return;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PULL 11/25] qdist: use g_renew and g_new instead of g_realloc and g_malloc.
2016-08-03 17:04 [Qemu-devel] [PULL v2 00/25] Misc QEMU fixes for 2016-08-02 Paolo Bonzini
@ 2016-08-03 17:04 ` Paolo Bonzini
2016-08-04 10:19 ` [Qemu-devel] [PULL v2 00/25] Misc QEMU fixes for 2016-08-02 Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-08-03 17:04 UTC (permalink / raw)
To: qemu-devel; +Cc: Emilio G. Cota
From: "Emilio G. Cota" <cota@braap.org>
This is safer against overflow. g_renew is available in all
version of glib, while g_realloc_n is only available in 2.24.
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <1469459025-23606-3-git-send-email-cota@braap.org>
[Rewritten to use g_new/g_renew. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
util/qdist.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/util/qdist.c b/util/qdist.c
index eb2236c..e95722b 100644
--- a/util/qdist.c
+++ b/util/qdist.c
@@ -16,7 +16,7 @@
void qdist_init(struct qdist *dist)
{
- dist->entries = g_malloc(sizeof(*dist->entries));
+ dist->entries = g_new(struct qdist_entry, 1);
dist->size = 1;
dist->n = 0;
}
@@ -62,8 +62,7 @@ void qdist_add(struct qdist *dist, double x, long count)
if (unlikely(dist->n == dist->size)) {
dist->size *= 2;
- dist->entries = g_realloc(dist->entries,
- sizeof(*dist->entries) * (dist->size));
+ dist->entries = g_renew(struct qdist_entry, dist->entries, dist->size);
}
dist->n++;
entry = &dist->entries[dist->n - 1];
@@ -188,7 +187,7 @@ void qdist_bin__internal(struct qdist *to, const struct qdist *from, size_t n)
}
}
/* they're equally spaced, so copy the dist and bail out */
- to->entries = g_realloc_n(to->entries, n, sizeof(*to->entries));
+ to->entries = g_renew(struct qdist_entry, to->entries, n);
to->n = from->n;
memcpy(to->entries, from->entries, sizeof(*to->entries) * to->n);
return;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL v2 00/25] Misc QEMU fixes for 2016-08-02
2016-08-03 17:04 [Qemu-devel] [PULL v2 00/25] Misc QEMU fixes for 2016-08-02 Paolo Bonzini
2016-08-03 17:04 ` [Qemu-devel] [PULL 11/25] qdist: use g_renew and g_new instead of g_realloc and g_malloc Paolo Bonzini
@ 2016-08-04 10:19 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2016-08-04 10:19 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: QEMU Developers
On 3 August 2016 at 18:04, Paolo Bonzini <pbonzini@redhat.com> wrote:
> The following changes since commit cc0100f464c94bf80ad36cd432f4a1ed58126b60:
>
> MAINTAINERS: Update the Xilinx maintainers (2016-08-01 15:31:32 +0100)
>
> are available in the git repository at:
>
> git://github.com/bonzini/qemu.git tags/for-upstream
>
> for you to fetch changes up to e911765cbb9e9ddf5d952c88bb52180a62c6cea0:
>
> util: Fix assertion in iov_copy() upon zero 'bytes' and non-zero 'offset' (2016-08-03 18:44:57 +0200)
>
> ----------------------------------------------------------------
> * xsetbv fix (x86 targets TCG)
> * remove unused functions
> * qht segfault and memory leak fixes
> * NBD fixes
> * Fix for non-power-of-2 discard granularity
> * Memory hotplug fixes
> * Migration regressions
> * IOAPIC fixes and (disabled by default) EOI register support
> * Various other small fixes
>
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-08-04 10:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03 17:04 [Qemu-devel] [PULL v2 00/25] Misc QEMU fixes for 2016-08-02 Paolo Bonzini
2016-08-03 17:04 ` [Qemu-devel] [PULL 11/25] qdist: use g_renew and g_new instead of g_realloc and g_malloc Paolo Bonzini
2016-08-04 10:19 ` [Qemu-devel] [PULL v2 00/25] Misc QEMU fixes for 2016-08-02 Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).