qemu-e2k/target/arm
Markus Armbruster d2623129a7 qom: Drop parameter @errp of object_property_add() & friends
The only way object_property_add() can fail is when a property with
the same name already exists.  Since our property names are all
hardcoded, failure is a programming error, and the appropriate way to
handle it is passing &error_abort.

Same for its variants, except for object_property_add_child(), which
additionally fails when the child already has a parent.  Parentage is
also under program control, so this is a programming error, too.

We have a bit over 500 callers.  Almost half of them pass
&error_abort, slightly fewer ignore errors, one test case handles
errors, and the remaining few callers pass them to their own callers.

The previous few commits demonstrated once again that ignoring
programming errors is a bad idea.

Of the few ones that pass on errors, several violate the Error API.
The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.  ich9_pm_add_properties(), sparc32_ledma_realize(),
sparc32_dma_realize(), xilinx_axidma_realize(), xilinx_enet_realize()
are wrong that way.

When the one appropriate choice of argument is &error_abort, letting
users pick the argument is a bad idea.

Drop parameter @errp and assert the preconditions instead.

There's one exception to "duplicate property name is a programming
error": the way object_property_add() implements the magic (and
undocumented) "automatic arrayification".  Don't drop @errp there.
Instead, rename object_property_add() to object_property_try_add(),
and add the obvious wrapper object_property_add().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200505152926.18877-15-armbru@redhat.com>
[Two semantic rebase conflicts resolved]
2020-05-15 07:07:58 +02:00
..
Makefile.objs target/arm: Restrict TCG cpus to TCG accel 2020-05-11 11:45:59 +01:00
a32-uncond.decode target/arm: Convert Unallocated memory hint 2019-09-05 13:23:03 +01:00
a32.decode target/arm: Convert SVC 2019-09-05 13:23:03 +01:00
arch_dump.c target/arm: Add isar_feature_aa32_vfp_simd 2020-02-28 16:14:57 +00:00
arm-powerctl.c arm/arm-powerctl: rebuild hflags after setting CP15 bits in arm_set_cpu_on() 2019-12-20 14:03:00 +00:00
arm-powerctl.h target/arm/arm-powerctl: Add new arm_set_cpu_on_and_reset() 2019-02-28 11:03:04 +00:00
arm-semi.c target/arm/arm-semi: Don't let the guest close stdin/stdout/stderr 2020-01-30 16:02:01 +00:00
arm_ldst.h target/arm: fetch code with translator_ld 2019-10-28 15:12:38 +00:00
cpu-param.h target/arm: Don't use a TLB for ARMMMUIdx_Stage2 2020-05-04 10:32:46 +01:00
cpu-qom.h target/arm: Make cpu_register() available for other files 2020-04-30 15:35:41 +01:00
cpu.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cpu.h target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
cpu64.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cpu_tcg.c target/arm: Use correct GDB XML for M-profile cores 2020-05-14 15:03:08 +01:00
crypto_helper.c target: Do not include "exec/exec-all.h" if it is not necessary 2018-06-01 14:15:10 +02:00
debug_helper.c target/arm: Stop assuming DBGDIDR always exists 2020-02-21 16:07:01 +00:00
gdbstub.c target/arm: Use correct GDB XML for M-profile cores 2020-05-14 15:03:08 +01:00
gdbstub64.c gdbstub: extend GByteArray to read register helpers 2020-03-17 17:38:38 +00:00
helper-a64.c target/arm: Move helper_dc_zva to helper-a64.c 2020-03-05 16:09:20 +00:00
helper-a64.h target/arm: Use DEF_HELPER_FLAGS for helper_dc_zva 2020-03-05 16:09:21 +00:00
helper-sve.h target/arm: Use tcg_gen_gvec_5_ptr for sve FMLA/FCMLA 2020-05-11 11:59:22 +01:00
helper.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
helper.h target/arm: Move 'env' argument of recps_f32 and rsqrts_f32 helpers to usual place 2020-05-14 15:03:09 +01:00
idau.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
internals.h target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
iwmmxt_helper.c target/arm: Untabify iwmmxt_helper.c 2018-08-24 13:17:48 +01:00
kvm-consts.h arm: add trailing ; after MISMATCH_CHECK 2017-02-01 03:37:18 +02:00
kvm-stub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
kvm.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
kvm32.c target/arm/kvm: Inline set_feature() calls 2020-05-11 11:45:59 +01:00
kvm64.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
kvm_arm.h target/arm/kvm: Let kvm_arm_vgic_probe() return a bitmap 2020-03-12 16:27:33 +00:00
m_helper.c target/arm: Add isar_feature_aa32_vfp_simd 2020-02-28 16:14:57 +00:00
machine.c target/arm: Add isar_feature_aa64_fp_simd, isar_feature_aa32_vfp 2020-02-28 16:14:57 +00:00
monitor.c Use &error_abort instead of separate assert() 2020-03-17 16:05:40 +01:00
neon-dp.decode target/arm: Convert NEON VFMA, VFMS 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
neon-ls.decode target/arm: Convert Neon 'load/store single structure' to decodetree 2020-05-04 12:57:56 +01:00
neon-shared.decode target/arm: Convert VFM[AS]L (scalar) to decodetree 2020-05-04 12:57:56 +01:00
neon_helper.c target/arm: Convert Neon VADD, VSUB, VABD 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
op_addsub.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
op_helper.c target/arm: Move helper_dc_zva to helper-a64.c 2020-03-05 16:09:20 +00:00
pauth_helper.c target/arm: Use bit 55 explicitly for pauth 2020-02-21 16:07:00 +00:00
psci.c sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
sve.decode target/arm: SVE brk[ab] merging does not have s bit 2019-01-07 15:23:45 +00:00
sve_helper.c target/arm: Use tcg_gen_gvec_5_ptr for sve FMLA/FCMLA 2020-05-11 11:59:22 +01:00
t16.decode target/arm: Convert T16, long branches 2019-09-05 13:23:04 +01:00
t32.decode target/arm: Convert TT 2019-09-05 13:23:03 +01:00
tlb_helper.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
translate-a64.c target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
translate-a64.h target/arm: Convert Neon 3-reg-same VADD/VSUB to decodetree 2020-05-04 12:57:56 +01:00
translate-neon.inc.c target/arm: Convert NEON VFMA, VFMS 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
translate-sve.c target/arm: Fix tcg_gen_gvec_dup_imm vs DUP (indexed) 2020-05-11 14:22:54 +01:00
translate-vfp.inc.c target/arm/translate-vfp.inc.c: Remove duplicate simd_r32 check 2020-05-04 12:57:56 +01:00
translate.c target/arm: Convert NEON VFMA, VFMS 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
translate.h target/arm: Vectorize SABA/UABA 2020-05-14 15:03:08 +01:00
vec_helper.c target/arm: Convert Neon VADD, VSUB, VABD 3-reg-same insns to decodetree 2020-05-14 15:03:09 +01:00
vfp-uncond.decode target/arm: Split VMINMAXNM decode 2020-02-28 16:14:57 +00:00
vfp.decode target/arm: Split VFM decode 2020-02-28 16:14:57 +00:00
vfp_helper.c target/arm: Move 'env' argument of recps_f32 and rsqrts_f32 helpers to usual place 2020-05-14 15:03:09 +01:00