diff options
author | Markus Armbruster | 2020-05-05 17:29:15 +0200 |
---|---|---|
committer | Markus Armbruster | 2020-05-15 07:06:49 +0200 |
commit | 7eecec7d1224890b0d04479dd4736e1eefaa72dc (patch) | |
tree | 58da9dda7cf32c9297f6d710d6dac2f0bf493448 /target/s390x/cpu_models.c | |
parent | qom: Make all the object_property_add_FOO() return the property (diff) | |
download | qemu-7eecec7d1224890b0d04479dd4736e1eefaa72dc.tar.gz qemu-7eecec7d1224890b0d04479dd4736e1eefaa72dc.tar.xz qemu-7eecec7d1224890b0d04479dd4736e1eefaa72dc.zip |
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]
Diffstat (limited to 'target/s390x/cpu_models.c')
-rw-r--r-- | target/s390x/cpu_models.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 7c32180269..aa7fc713ca 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -1107,13 +1107,13 @@ void s390_cpu_model_register_props(Object *obj) const S390FeatDef *def = s390_feat_def(feat); object_property_add(obj, def->name, "bool", get_feature, set_feature, NULL, (void *) feat, NULL); - object_property_set_description(obj, def->name, def->desc , NULL); + object_property_set_description(obj, def->name, def->desc); } for (group = 0; group < S390_FEAT_GROUP_MAX; group++) { const S390FeatGroupDef *def = s390_feat_group_def(group); object_property_add(obj, def->name, "bool", get_feature_group, set_feature_group, NULL, (void *) group, NULL); - object_property_set_description(obj, def->name, def->desc , NULL); + object_property_set_description(obj, def->name, def->desc); } } |