qemu-patch-raspberry4/qom
Markus Armbruster 7eecec7d12 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]
2020-05-15 07:06:49 +02:00
..
container.c qom: Clean up inconsistent use of gchar * vs. char * 2020-05-15 06:26:02 +02:00
Makefile.objs qemu-storage-daemon: Add --object option 2020-03-06 17:21:28 +01:00
object.c qom: Drop object_property_set_description() parameter @errp 2020-05-15 07:06:49 +02:00
object_interfaces.c qemu-storage-daemon: Fix non-string --object properties 2020-04-30 17:51:07 +02:00
qom-hmp-cmds.c hmp: drop Error pointer indirection in hmp_handle_error 2019-12-18 08:36:16 +01:00
qom-qmp-cmds.c qemu-storage-daemon: Fix non-string --object properties 2020-04-30 17:51:07 +02:00
qom-qobject.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-events trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00