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
..
a32-uncond.decode
a32.decode
arch_dump.c target/arm: Add isar_feature_aa32_vfp_simd 2020-02-28 16:14:57 +00:00
arm_ldst.h
arm-powerctl.c
arm-powerctl.h
arm-semi.c
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
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
crypto_helper.c
debug_helper.c target/arm: Stop assuming DBGDIDR always exists 2020-02-21 16:07:01 +00:00
gdbstub64.c gdbstub: extend GByteArray to read register helpers 2020-03-17 17:38:38 +00:00
gdbstub.c target/arm: Use correct GDB XML for M-profile cores 2020-05-14 15:03:08 +01: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
internals.h target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
iwmmxt_helper.c
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
kvm-consts.h
kvm-stub.c
kvm.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02: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
Makefile.objs target/arm: Restrict TCG cpus to TCG accel 2020-05-11 11:45:59 +01:00
monitor.c Use &error_abort instead of separate assert() 2020-03-17 16:05:40 +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
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
op_addsub.h
op_helper.c target/arm: Move helper_dc_zva to helper-a64.c 2020-03-05 16:09:20 +00:00
pauth_helper.c
psci.c
sve_helper.c target/arm: Use tcg_gen_gvec_5_ptr for sve FMLA/FCMLA 2020-05-11 11:59:22 +01:00
sve.decode
t16.decode
t32.decode
tlb_helper.c target-arm: kvm64: handle SIGBUS signal from kernel or KVM 2020-05-14 15:03:09 +01:00
trace-events
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_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
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