[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 2/8] spapr: do proper error propagation in spapr_cpu_c
From: |
Greg Kurz |
Subject: |
[Qemu-ppc] [PATCH 2/8] spapr: do proper error propagation in spapr_cpu_core_realize_child() |
Date: |
Wed, 29 Jun 2016 22:50:32 +0200 |
User-agent: |
StGit/0.17.1-dirty |
This patch changes spapr_cpu_core_realize_child() to have a local error
pointer and use error_propagate() as it is supposed to be done.
Signed-off-by: Greg Kurz <address@hidden>
---
hw/ppc/spapr_cpu_core.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c
index 789eb2e6f206..2615058da745 100644
--- a/hw/ppc/spapr_cpu_core.c
+++ b/hw/ppc/spapr_cpu_core.c
@@ -261,20 +261,22 @@ out:
}
static int spapr_cpu_core_realize_child(Object *child, void *opaque)
{
- Error **errp = opaque;
+ Error **errp = opaque, *local_err = NULL;
sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
CPUState *cs = CPU(child);
PowerPCCPU *cpu = POWERPC_CPU(cs);
- object_property_set_bool(child, true, "realized", errp);
- if (*errp) {
+ object_property_set_bool(child, true, "realized", &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
return 1;
}
- spapr_cpu_init(spapr, cpu, errp);
- if (*errp) {
+ spapr_cpu_init(spapr, cpu, &local_err);
+ if (local_err) {
+ error_propagate(errp, local_err);
return 1;
}
return 0;
}
- [Qemu-ppc] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, Greg Kurz, 2016/06/29
- [Qemu-ppc] [PATCH 1/8] spapr: drop reference on child object during core realization, Greg Kurz, 2016/06/29
- [Qemu-ppc] [PATCH 2/8] spapr: do proper error propagation in spapr_cpu_core_realize_child(),
Greg Kurz <=
- [Qemu-ppc] [PATCH 3/8] spapr: drop duplicate variable in spapr_core_release(), Greg Kurz, 2016/06/29
- [Qemu-ppc] [PATCH 4/8] exec: add missing conditional compilation, Greg Kurz, 2016/06/29
- [Qemu-ppc] [PATCH 5/8] exec: move cpu_index init and exit to their own function, Greg Kurz, 2016/06/29
- [Qemu-ppc] [PATCH 6/8] ppc: move cpu index setup to instance_init/finalize, Greg Kurz, 2016/06/29
- [Qemu-ppc] [PATCH 7/8] cpu: add initialization helper without realize, Greg Kurz, 2016/06/29
- [Qemu-ppc] [PATCH 8/8] hw/ppc: move DT cpu id generation to machine code, Greg Kurz, 2016/06/29
- Re: [Qemu-ppc] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, Greg Kurz, 2016/06/29
- Re: [Qemu-ppc] [PATCH 0/8] ppc: compute cpu_dt_id in the machine code, David Gibson, 2016/06/30