[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/18] spapr_cpu_core: cleaning up qdev_get_machine()
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 16/18] spapr_cpu_core: cleaning up qdev_get_machine() calls |
Date: |
Fri, 15 Sep 2017 13:51:28 +1000 |
From: Greg Kurz <address@hidden>
This patch removes the qdev_get_machine() calls that are made
in spapr_cpu_core.c in situations where we can get an existing
pointer for the MachineState by either passing it as an argument
to the function or by using other already available pointers.
Credits to Daniel Henrique Barboza for the idea and the changelog
text.
Signed-off-by: Greg Kurz <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr_cpu_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 3f7ef20910..c08ee7571a 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -174,10 +174,10 @@ static void spapr_cpu_core_unrealizefn(DeviceState *dev,
Error **errp)
g_free(sc->threads);
}
-static void spapr_cpu_core_realize_child(Object *child, Error **errp)
+static void spapr_cpu_core_realize_child(Object *child,
+ sPAPRMachineState *spapr, Error
**errp)
{
Error *local_err = NULL;
- sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
CPUState *cs = CPU(child);
PowerPCCPU *cpu = POWERPC_CPU(cs);
Object *obj;
@@ -266,7 +266,7 @@ static void spapr_cpu_core_realize(DeviceState *dev, Error
**errp)
for (j = 0; j < cc->nr_threads; j++) {
obj = sc->threads + j * size;
- spapr_cpu_core_realize_child(obj, &local_err);
+ spapr_cpu_core_realize_child(obj, spapr, &local_err);
if (local_err) {
goto err;
}
--
2.13.5
- [Qemu-devel] [PULL 10/18] spapr_pci: handle FDT creation errors with _FDT(), (continued)
- [Qemu-devel] [PULL 10/18] spapr_pci: handle FDT creation errors with _FDT(), David Gibson, 2017/09/14
- [Qemu-devel] [PULL 17/18] spapr_events: use QTAILQ_FOREACH_SAFE() in spapr_clear_pending_events(), David Gibson, 2017/09/14
- [Qemu-devel] [PULL 18/18] ppc/kvm: use kvm_vm_check_extension() in kvmppc_is_pr(), David Gibson, 2017/09/14
- [Qemu-devel] [PULL 05/18] spapr_pci: use g_strdup_printf(), David Gibson, 2017/09/14
- [Qemu-devel] [PULL 01/18] net: Add SunGEM device emulation as found on Apple UniNorth, David Gibson, 2017/09/14
- [Qemu-devel] [PULL 11/18] vfio, spapr: Fix levels calculation, David Gibson, 2017/09/14
- [Qemu-devel] [PULL 07/18] ppc/xive: fix OV5_XIVE_EXPLOIT bits, David Gibson, 2017/09/14
- [Qemu-devel] [PULL 09/18] spapr_pci: use the common _FDT() helper, David Gibson, 2017/09/14
- [Qemu-devel] [PULL 13/18] spapr_cpu_core: fail gracefully with non-pseries machine types, David Gibson, 2017/09/14
- [Qemu-devel] [PULL 12/18] xics: fix several error leaks, David Gibson, 2017/09/14
- [Qemu-devel] [PULL 16/18] spapr_cpu_core: cleaning up qdev_get_machine() calls,
David Gibson <=
- [Qemu-devel] [PULL 14/18] spapr_pci: convert sprintf() to g_strdup_printf(), David Gibson, 2017/09/14
- Re: [Qemu-devel] [PULL 00/18] ppc-for-2.11 queue 20170915, no-reply, 2017/09/15
- Re: [Qemu-devel] [PULL 00/18] ppc-for-2.11 queue 20170915, Peter Maydell, 2017/09/15