aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2020-05-05 17:29:15 +0200
committerMarkus Armbruster <armbru@redhat.com>2020-05-15 07:06:49 +0200
commit7eecec7d1224890b0d04479dd4736e1eefaa72dc (patch)
tree58da9dda7cf32c9297f6d710d6dac2f0bf493448 /hw/s390x
parent702518877220187a858da1a6ba08d53995dc6e2f (diff)
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 'hw/s390x')
-rw-r--r--hw/s390x/css-bridge.c3
-rw-r--r--hw/s390x/s390-virtio-ccw.c9
2 files changed, 4 insertions, 8 deletions
diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c
index a306a78e6c..c9ce06b043 100644
--- a/hw/s390x/css-bridge.c
+++ b/hw/s390x/css-bridge.c
@@ -144,8 +144,7 @@ static void virtual_css_bridge_class_init(ObjectClass *klass, void *data)
prop_get_true, NULL, NULL);
object_class_property_set_description(klass, "cssid-unrestricted",
"A css device can use any cssid, regardless whether virtual"
- " or not (read only, always true)",
- NULL);
+ " or not (read only, always true)");
}
static const TypeInfo virtual_css_bridge_info = {
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index f660070d22..2f94061ff6 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -731,24 +731,21 @@ static inline void s390_machine_initfn(Object *obj)
machine_get_aes_key_wrap,
machine_set_aes_key_wrap, NULL);
object_property_set_description(obj, "aes-key-wrap",
- "enable/disable AES key wrapping using the CPACF wrapping key",
- NULL);
+ "enable/disable AES key wrapping using the CPACF wrapping key");
object_property_set_bool(obj, true, "aes-key-wrap", NULL);
object_property_add_bool(obj, "dea-key-wrap",
machine_get_dea_key_wrap,
machine_set_dea_key_wrap, NULL);
object_property_set_description(obj, "dea-key-wrap",
- "enable/disable DEA key wrapping using the CPACF wrapping key",
- NULL);
+ "enable/disable DEA key wrapping using the CPACF wrapping key");
object_property_set_bool(obj, true, "dea-key-wrap", NULL);
object_property_add_str(obj, "loadparm",
machine_get_loadparm, machine_set_loadparm, NULL);
object_property_set_description(obj, "loadparm",
"Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted"
" to upper case) to pass to machine loader, boot manager,"
- " and guest kernel",
- NULL);
+ " and guest kernel");
}
static const TypeInfo ccw_machine_info = {