From df4fe0b291b2baf1694517a4a67be7525102656b Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 5 May 2020 17:29:26 +0200 Subject: qom: Drop @errp parameter of object_property_del() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same story as for object_property_add(): the only way object_property_del() can fail is when the property with this name does not exist. Since our property names are all hardcoded, failure is a programming error, and the appropriate way to handle it is passing &error_abort. Most callers do that, the commit before previous fixed one that didn't (and got the error handling wrong), and the two remaining exceptions ignore errors. Drop the @errp parameter. Signed-off-by: Markus Armbruster Reviewed-by: Paolo Bonzini Message-Id: <20200505152926.18877-19-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé --- hw/core/qdev.c | 2 +- hw/i386/pc_sysfw.c | 2 +- hw/ppc/spapr_drc.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'hw') diff --git a/hw/core/qdev.c b/hw/core/qdev.c index b9c7a2f..9e5538a 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -65,7 +65,7 @@ static void bus_remove_child(BusState *bus, DeviceState *child) bus->num_children--; /* This gives back ownership of kid->child back to us. */ - object_property_del(OBJECT(bus), name, NULL); + object_property_del(OBJECT(bus), name); object_unref(OBJECT(kid->child)); g_free(kid); return; diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c index 002133a..2abab3a 100644 --- a/hw/i386/pc_sysfw.c +++ b/hw/i386/pc_sysfw.c @@ -120,7 +120,7 @@ static void pc_system_flash_cleanup_unused(PCMachineState *pcms) dev_obj = OBJECT(pcms->flash[i]); if (!object_property_get_bool(dev_obj, "realized", &error_abort)) { prop_name = g_strdup_printf("pflash%d", i); - object_property_del(OBJECT(pcms), prop_name, &error_abort); + object_property_del(OBJECT(pcms), prop_name); g_free(prop_name); object_unparent(dev_obj); pcms->flash[i] = NULL; diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 8b2171f..b958f8a 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -405,7 +405,7 @@ static void spapr_drc_release(SpaprDrc *drc) g_free(drc->fdt); drc->fdt = NULL; drc->fdt_start_offset = 0; - object_property_del(OBJECT(drc), "device", &error_abort); + object_property_del(OBJECT(drc), "device"); drc->dev = NULL; } @@ -551,7 +551,7 @@ static void unrealize(DeviceState *d) vmstate_unregister(VMSTATE_IF(drc), &vmstate_spapr_drc, drc); root_container = container_get(object_get_root(), DRC_CONTAINER_PATH); name = g_strdup_printf("%x", spapr_drc_index(drc)); - object_property_del(root_container, name, &error_abort); + object_property_del(root_container, name); g_free(name); } -- cgit v1.1