[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 11/14] spapr: Correct reference count on spapr-cpu-core
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 11/14] spapr: Correct reference count on spapr-cpu-core |
Date: |
Fri, 7 Sep 2018 17:31:52 +1000 |
From: Sam Bobroff <address@hidden>
spapr_init_cpus() currently creates spapr-cpu-core objects via
object_new() and setting their realized property to true. This leaves
their reference count at two, because object_new() adds an initial
reference and the realization attaches them to a default parent object
which also increments the reference count.
This causes a problem if one of these cores is hot unplugged: no
delete event is generated for it because it's reference count doesn't
reach zero when it is detached from it's parent.
Correct this by adding a call to object_unref() in spapr_init_cpus().
Signed-off-by: Sam Bobroff <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 505d4c84e5..4a9dd4d9bc 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2480,6 +2480,8 @@ static void spapr_init_cpus(sPAPRMachineState *spapr)
object_property_set_int(core, core_id, CPU_CORE_PROP_CORE_ID,
&error_fatal);
object_property_set_bool(core, true, "realized", &error_fatal);
+
+ object_unref(core);
}
}
}
--
2.17.1
- [Qemu-ppc] [PULL 06/14] macio: add addr property to macio IDE object, (continued)
[Qemu-ppc] [PULL 03/14] spapr_pci: fix potential NULL pointer dereference, David Gibson, 2018/09/07
[Qemu-ppc] [PULL 13/14] target/ppc/kvm: set vcpu as online/offline, David Gibson, 2018/09/07
[Qemu-ppc] [PULL 12/14] Fix a deadlock case in the CPU hotplug flow, David Gibson, 2018/09/07
[Qemu-ppc] [PULL 11/14] spapr: Correct reference count on spapr-cpu-core,
David Gibson <=
[Qemu-ppc] [PULL 07/14] grackle: set device fw_name and address for correct fw path generation, David Gibson, 2018/09/07
Re: [Qemu-ppc] [PULL 00/14] ppc-for-3.1 queue 20180907, Peter Maydell, 2018/09/24