From efba15959cdb1ca7beeed8d6188ab0905b468f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Mon, 14 Sep 2020 14:56:17 +0100 Subject: qom: simplify object_find_property / object_class_find_property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When debugging QEMU it is often useful to put a breakpoint on the error_setg_internal method impl. Unfortunately the object_property_add / object_class_property_add methods call object_property_find / object_class_property_find methods to check if a property exists already before adding the new property. As a result there are a huge number of calls to error_setg_internal on startup of most QEMU commands, making it very painful to set a breakpoint on this method. Most callers of object_find_property and object_class_find_property, however, pass in a NULL for the Error parameter. This simplifies the methods to remove the Error parameter entirely, and then adds some new wrapper methods that are able to raise an Error when needed. Signed-off-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200914135617.1493072-1-berrange@redhat.com> Signed-off-by: Eduardo Habkost --- hw/arm/integratorcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/arm/integratorcp.c') diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c index de670b08a9..16e8985953 100644 --- a/hw/arm/integratorcp.c +++ b/hw/arm/integratorcp.c @@ -603,7 +603,7 @@ static void integratorcp_init(MachineState *machine) * currently support EL3 so the CPU EL3 property is disabled before * realization. */ - if (object_property_find(cpuobj, "has_el3", NULL)) { + if (object_property_find(cpuobj, "has_el3")) { object_property_set_bool(cpuobj, "has_el3", false, &error_fatal); } -- cgit v1.2.3