diff options
author | Greg Kurz | 2017-11-20 10:19:54 +0100 |
---|---|---|
committer | David Gibson | 2017-12-14 23:49:23 +0100 |
commit | 94ad93bd976841c26af75322301f5aad925114d6 (patch) | |
tree | ebfc6e7d0cfdd6a696e75777b9c2902c38aa30ad /slirp/ip_output.c | |
parent | spapr: Add pseries-2.12 machine type (diff) | |
download | qemu-94ad93bd976841c26af75322301f5aad925114d6.tar.gz qemu-94ad93bd976841c26af75322301f5aad925114d6.tar.xz qemu-94ad93bd976841c26af75322301f5aad925114d6.zip |
spapr_cpu_core: instantiate CPUs separately
The current code assumes that only the CPU core object holds a
reference on each individual CPU object, and happily frees their
allocated memory when the core is unrealized. This is dangerous
as some other code can legitimely keep a pointer to a CPU if it
calls object_ref(), but it would end up with a dangling pointer.
Let's allocate all CPUs with object_new() and let QOM free them
when their reference count reaches zero. This greatly simplify the
code as we don't have to fiddle with the instance size anymore.
Signed-off-by: Greg Kurz <groug@kaod.org>
Acked-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'slirp/ip_output.c')
0 files changed, 0 insertions, 0 deletions