summaryrefslogtreecommitdiff
path: root/hw/arm/virt.c
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/arm/virt.c
parent702518877220187a858da1a6ba08d53995dc6e2f (diff)
downloadqemu-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 'hw/arm/virt.c')
-rw-r--r--hw/arm/virt.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 9e76fa7b01..de66def51e 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -2272,7 +2272,7 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
virt_get_acpi, virt_set_acpi,
NULL, NULL, &error_abort);
object_class_property_set_description(oc, "acpi",
- "Enable ACPI", &error_abort);
+ "Enable ACPI");
}
static void virt_instance_init(Object *obj)
@@ -2289,8 +2289,7 @@ static void virt_instance_init(Object *obj)
virt_set_secure, NULL);
object_property_set_description(obj, "secure",
"Set on/off to enable/disable the ARM "
- "Security Extensions (TrustZone)",
- NULL);
+ "Security Extensions (TrustZone)");
/* EL2 is also disabled by default, for similar reasons */
vms->virt = false;
@@ -2299,8 +2298,7 @@ static void virt_instance_init(Object *obj)
object_property_set_description(obj, "virtualization",
"Set on/off to enable/disable emulating a "
"guest CPU which implements the ARM "
- "Virtualization Extensions",
- NULL);
+ "Virtualization Extensions");
/* High memory is enabled by default */
vms->highmem = true;
@@ -2308,15 +2306,13 @@ static void virt_instance_init(Object *obj)
virt_set_highmem, NULL);
object_property_set_description(obj, "highmem",
"Set on/off to enable/disable using "
- "physical address space above 32 bits",
- NULL);
+ "physical address space above 32 bits");
vms->gic_version = VIRT_GIC_VERSION_NOSEL;
object_property_add_str(obj, "gic-version", virt_get_gic_version,
virt_set_gic_version, NULL);
object_property_set_description(obj, "gic-version",
"Set GIC version. "
- "Valid values are 2, 3, host and max",
- NULL);
+ "Valid values are 2, 3, host and max");
vms->highmem_ecam = !vmc->no_highmem_ecam;
@@ -2329,8 +2325,7 @@ static void virt_instance_init(Object *obj)
virt_set_its, NULL);
object_property_set_description(obj, "its",
"Set on/off to enable/disable "
- "ITS instantiation",
- NULL);
+ "ITS instantiation");
}
/* Default disallows iommu instantiation */
@@ -2338,8 +2333,7 @@ static void virt_instance_init(Object *obj)
object_property_add_str(obj, "iommu", virt_get_iommu, virt_set_iommu, NULL);
object_property_set_description(obj, "iommu",
"Set the IOMMU type. "
- "Valid values are none and smmuv3",
- NULL);
+ "Valid values are none and smmuv3");
/* Default disallows RAS instantiation */
vms->ras = false;
@@ -2347,8 +2341,7 @@ static void virt_instance_init(Object *obj)
virt_set_ras, NULL);
object_property_set_description(obj, "ras",
"Set on/off to enable/disable reporting host memory errors "
- "to a KVM guest using ACPI and guest external abort exceptions",
- NULL);
+ "to a KVM guest using ACPI and guest external abort exceptions");
vms->irqmap = a15irqmap;