qemu-patch-raspberry4/target/ppc
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
..
translate target/ppc: Use tcg_gen_gvec_dup_imm 2020-05-06 09:25:01 -07:00
arch_dump.c target/ppc: Add helper_mfvscr 2019-02-18 11:00:44 +11:00
compat.c qom: Drop parameter @errp of object_property_add() & friends 2020-05-15 07:07:58 +02:00
cpu-models.c target/ppc: Add POWER10 DD1.0 model information 2019-12-17 10:39:48 +11:00
cpu-models.h target/ppc: Add POWER10 DD1.0 model information 2019-12-17 10:39:48 +11:00
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 07:03:34 -07:00
cpu-qom.h x86 and machine queue for 5.0 soft freeze 2020-03-19 14:22:46 +00:00
cpu.c target/ppc: support for 32-bit carry and overflow 2017-03-01 11:23:39 +11:00
cpu.h target/ppc: Add support for Radix partition-scoped translation 2020-05-07 11:10:50 +10:00
dfp_helper.c target/ppc: remove unnecessary if() around calls to set_dfp{64,128}() in DFP macros 2019-10-04 19:08:21 +10:00
excp_helper.c target/ppc: Add support for Radix partition-scoped translation 2020-05-07 11:10:50 +10:00
fpu_helper.c target/ppc: Fix typo in comments 2020-02-21 09:15:04 +11:00
gdbstub.c gdbstub: Introduce gdb_get_float64() to get 64-bit float registers 2020-05-06 09:29:26 +01:00
helper.h target/ppc: Fix ISA v3.0 (POWER9) slbia implementation 2020-03-24 11:56:14 +11:00
helper_regs.h ppc: Ignore the CPU_INTERRUPT_EXITTB interrupt with KVM 2019-12-17 10:39:48 +11:00
int_helper.c target/ppc: use Vsr macros in BCD helpers 2019-10-04 19:08:21 +10:00
internal.h ppc: Add support for 'mffscrn','mffscrni' instructions 2019-10-04 10:25:23 +10:00
kvm-stub.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
kvm.c target/ppc: Fix wrong interpretation of the disposition flag. 2020-04-17 10:38:29 +10:00
kvm_ppc.h ppc/spapr: KVM FWNMI should not be enabled until guest requests it 2020-04-07 08:55:10 +10:00
machine.c Include hw/boards.h a bit less 2019-08-16 13:31:53 +02:00
Makefile.objs build: remove CONFIG_LIBDECNUMBER 2017-10-16 18:03:52 +02:00
mem_helper.c target/ppc: Use probe_write for DCBZ 2020-02-03 11:33:11 +11:00
mfrom_table.inc.c target/ppc: Style fixes for mfrom_table.inc.c & mfrom_table_gen.c 2019-04-26 10:42:38 +10:00
mfrom_table_gen.c target/ppc: Style fixes for mfrom_table.inc.c & mfrom_table_gen.c 2019-04-26 10:42:38 +10:00
misc_helper.c target/ppc: add support for Hypervisor Facility Unavailable Exception 2020-02-02 14:07:57 +11:00
mmu-book3s-v3.c target/ppc: Support for POWER9 native hash 2019-02-26 09:21:25 +11:00
mmu-book3s-v3.h Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
mmu-hash32.c ppc/hash32: Rework R and C bit updates 2019-04-26 11:37:57 +10:00
mmu-hash32.h target/ppc: Manage external HPT via virtual hypervisor 2017-03-01 11:23:39 +11:00
mmu-hash64.c target/ppc: Fix ISA v3.0 (POWER9) slbia implementation 2020-03-24 11:56:14 +11:00
mmu-hash64.h ppc/hash64: Rework R and C bit updates 2019-04-26 11:37:57 +10:00
mmu-radix64.c target/ppc: Add support for Radix partition-scoped translation 2020-05-07 11:10:50 +10:00
mmu-radix64.h target/ppc: Rename PATB/PATBE -> PATE 2019-02-26 09:21:25 +11:00
mmu_helper.c target/ppc: Rewrite a fall through comment 2019-08-21 10:57:28 +02:00
monitor.c hmp: Move hmp.h to include/monitor/ 2019-07-02 07:19:45 +02:00
timebase_helper.c hw/ppc: Take QEMU lock when calling ppc_dcr_read/write() 2020-03-24 11:56:37 +11:00
trace-events target/ppc: Handle NMI guest exit 2020-02-03 11:33:10 +11:00
translate.c target-ppc: fix rlwimi, rlwinm, rlwnm for Clang-9 2020-05-07 11:10:50 +10:00
translate_init.inc.c gdbstub: Introduce gdb_get_float64() to get 64-bit float registers 2020-05-06 09:29:26 +01:00
user_only_helper.c target/ppc: Convert to CPUClass::tlb_fill 2019-05-10 11:12:50 -07:00