qemu-e2k/target/s390x
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 s390x/tcg: Implement VECTOR FP ADD 2019-06-07 14:53:25 +02:00
arch_dump.c s390x: Use uint64_t for vector registers 2019-06-07 14:53:25 +02:00
cc_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 07:03:34 -07:00
cpu-qom.h cpu: Use DeviceClass reset instead of a special CPUClass reset 2020-03-17 19:48:10 -04:00
cpu.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cpu.h s390x: Add SIDA memory ops 2020-04-29 14:31:31 +02:00
cpu_features.c s390x/cpumodel: Rework CPU feature definition 2019-06-21 15:26:53 +02:00
cpu_features.h s390x/cpumodel: add Deflate-conversion facility 2019-05-21 16:59:16 +02:00
cpu_features_def.h s390x/cpumodel: Rework CPU feature definition 2019-06-21 15:26:53 +02:00
cpu_features_def.inc.h s390x/cpumodel: Fix UI to CPU features pcc-cmac-{aes,eaes}-256 2020-05-15 07:07:58 +02:00
cpu_models.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cpu_models.h hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
crypto_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
diag.c s390x: protvirt: Move diag 308 data over SIDA 2020-04-29 14:31:32 +02:00
excp_helper.c Let cpu_[physical]_memory() calls pass a boolean 'is_write' argument 2020-02-20 14:47:08 +01:00
fpu_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
gdbstub.c gdbstub: extend GByteArray to read register helpers 2020-03-17 17:38:38 +00:00
gen-features.c s390x: Add unpack facility feature to GA1 2020-04-29 14:31:32 +02:00
helper.c s390x: protvirt: Handle SIGP store status correctly 2020-04-29 14:31:32 +02:00
helper.h target/s390x: Implement LOAD/STORE TO REAL ADDRESS inline 2019-12-18 12:57:29 +01:00
insn-data.def target/s390x: Implement LOAD/STORE TO REAL ADDRESS inline 2019-12-18 12:57:29 +01:00
insn-format.def s390x/tcg: Define vector instruction formats 2019-03-11 09:31:01 +01:00
int_helper.c target/s390x: Use tcg_s390_program_interrupt in TCG helpers 2019-10-09 12:49:01 +02:00
internal.h gdbstub: extend GByteArray to read register helpers 2020-03-17 17:38:38 +00:00
interrupt.c target/s390x: Remove ilen argument from trigger_pgm_exception 2019-10-09 12:49:02 +02:00
ioinst.c s390x: protvirt: Move IO control structures over SIDA 2020-04-29 14:31:32 +02:00
kvm-stub.c s390x: protvirt: Support unpack facility 2020-04-29 14:30:54 +02:00
kvm.c s390x: Add unpack facility feature to GA1 2020-04-29 14:31:32 +02:00
kvm_s390x.h s390x: Add SIDA memory ops 2020-04-29 14:31:31 +02:00
machine.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
mem_helper.c tcg: Search includes from the project root source directory 2020-01-15 15:13:10 -10:00
misc_helper.c target/s390x: Split out helper_per_store_real 2019-12-18 12:57:29 +01:00
mmu_helper.c s390x: Add SIDA memory ops 2020-04-29 14:31:31 +02:00
s390-tod.h target/s390x: Split out s390-tod.h 2019-02-18 11:25:43 +01:00
sigp.c s390x: sigp: Fix sense running reporting 2020-01-27 12:13:10 +01:00
tcg-stub.c target/s390x: Remove ilen parameter from tcg_s390_program_interrupt 2019-10-09 12:49:01 +02:00
tcg_s390x.h target/s390x: Remove ilen parameter from tcg_s390_program_interrupt 2019-10-09 12:49:01 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
translate.c target/s390x/translate: Fix RNSBG instruction 2020-02-26 18:57:07 +01:00
translate_vx.inc.c target/s390x: Use tcg_gen_gvec_dup_imm 2020-05-06 09:25:00 -07:00
vec.h s390x/tcg: Implement VECTOR STRING RANGE COMPARE 2019-06-07 14:53:25 +02:00
vec_fpu_helper.c s390x/tcg: Implement VECTOR FP TEST DATA CLASS IMMEDIATE 2019-06-07 14:53:26 +02:00
vec_helper.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
vec_int_helper.c s390x/tcg: Fix VECTOR SUBTRACT COMPUTE BORROW INDICATION 2019-10-21 17:33:29 +02:00
vec_string_helper.c s390x/tcg: Implement VECTOR STRING RANGE COMPARE 2019-06-07 14:53:25 +02:00