]> git.proxmox.com Git - mirror_qemu.git/commit - hw/i386/pc.c
qom: Drop object_property_set_description() parameter @errp
authorMarkus Armbruster <armbru@redhat.com>
Tue, 5 May 2020 15:29:15 +0000 (17:29 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 15 May 2020 05:06:49 +0000 (07:06 +0200)
commit7eecec7d1224890b0d04479dd4736e1eefaa72dc
tree58da9dda7cf32c9297f6d710d6dac2f0bf493448
parent702518877220187a858da1a6ba08d53995dc6e2f
qom: Drop object_property_set_description() parameter @errp

object_property_set_description() and
object_class_property_set_description() fail only when property @name
is not found.

There are 85 calls of object_property_set_description() and
object_class_property_set_description().  None of them can fail:

* 84 immediately follow the creation of the property.

* The one in spapr_rng_instance_init() refers to a property created in
  spapr_rng_class_init(), from spapr_rng_properties[].

Every one of them still gets to decide what to pass for @errp.

51 calls pass &error_abort, 32 calls pass NULL, one receives the error
and propagates it to &error_abort, and one propagates it to
&error_fatal.  I'm actually surprised none of them violates the Error
API.

What are we gaining by letting callers handle the "property not found"
error?  Use when the property is not known to exist is simpler: you
don't have to guard the call with a check.  We haven't found such a
use in 5+ years.  Until we do, let's make life a bit simpler and drop
the @errp parameter.

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-8-armbru@redhat.com>
[One semantic rebase conflict resolved]
30 files changed:
accel/kvm/kvm-all.c
accel/tcg/tcg-all.c
backends/hostmem-memfd.c
backends/hostmem.c
hw/arm/aspeed.c
hw/arm/vexpress.c
hw/arm/virt.c
hw/arm/xlnx-zcu102.c
hw/core/machine.c
hw/core/qdev.c
hw/i386/microvm.c
hw/i386/pc.c
hw/i386/x86.c
hw/ppc/mac_newworld.c
hw/ppc/pnv.c
hw/ppc/spapr.c
hw/ppc/spapr_caps.c
hw/ppc/spapr_rng.c
hw/riscv/sifive_u.c
hw/s390x/css-bridge.c
hw/s390x/s390-virtio-ccw.c
hw/sparc/sun4m.c
hw/xen/xen-common.c
include/qom/object.h
qom/object.c
target/arm/cpu64.c
target/arm/kvm.c
target/i386/sev.c
target/ppc/compat.c
target/s390x/cpu_models.c