If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp == &fatal_err (program will exit before error_append_hint() call). Fix such cases.
This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz <gr...@kaod.org> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> --- hw/ppc/mac_newworld.c | 1 + hw/ppc/spapr.c | 1 + hw/ppc/spapr_pci.c | 1 + target/ppc/kvm.c | 2 ++ 4 files changed, 5 insertions(+) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index c5bbcc7433..939fdd258f 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -609,6 +609,7 @@ static char *core99_get_via_config(Object *obj, Error **errp) static void core99_set_via_config(Object *obj, const char *value, Error **errp) { + ERRP_FUNCTION_BEGIN(); Core99MachineState *cms = CORE99_MACHINE(obj); if (!strcmp(value, "cuda")) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 08a2a5a770..d0dd8aaa22 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4330,6 +4330,7 @@ int spapr_get_vcpu_id(PowerPCCPU *cpu) void spapr_set_vcpu_id(PowerPCCPU *cpu, int cpu_index, Error **errp) { + ERRP_FUNCTION_BEGIN(); SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine()); MachineState *ms = MACHINE(spapr); int vcpu_id; diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 7b71ad7c74..172d6689d0 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1817,6 +1817,7 @@ static void spapr_phb_destroy_msi(gpointer opaque) static void spapr_phb_realize(DeviceState *dev, Error **errp) { + ERRP_FUNCTION_BEGIN(); /* We don't use SPAPR_MACHINE() in order to exit gracefully if the user * tries to add a sPAPR PHB to a non-pseries machine. */ diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 8c5b1f25cc..aacfe194e2 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -237,6 +237,7 @@ static int kvm_booke206_tlb_init(PowerPCCPU *cpu) #if defined(TARGET_PPC64) static void kvm_get_smmu_info(struct kvm_ppc_smmu_info *info, Error **errp) { + ERRP_FUNCTION_BEGIN(); int ret; assert(kvm_state != NULL); @@ -2073,6 +2074,7 @@ int kvmppc_set_smt_threads(int smt) void kvmppc_hint_smt_possible(Error **errp) { + ERRP_FUNCTION_BEGIN(); int i; GString *g; char *s; -- 2.21.0