diff options
author | Daniel P. Berrangé | 2020-09-14 15:56:17 +0200 |
---|---|---|
committer | Eduardo Habkost | 2020-09-22 22:45:16 +0200 |
commit | efba15959cdb1ca7beeed8d6188ab0905b468f90 (patch) | |
tree | 5af4ba146184a2bcdc3100bd37388a04b11d3e43 /hw/pci/pci.c | |
parent | Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pul... (diff) | |
download | qemu-efba15959cdb1ca7beeed8d6188ab0905b468f90.tar.gz qemu-efba15959cdb1ca7beeed8d6188ab0905b468f90.tar.xz qemu-efba15959cdb1ca7beeed8d6188ab0905b468f90.zip |
qom: simplify object_find_property / object_class_find_property
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é <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200914135617.1493072-1-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/pci/pci.c')
-rw-r--r-- | hw/pci/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/pci/pci.c b/hw/pci/pci.c index de0fae10ab..fce725474b 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1900,7 +1900,7 @@ PCIDevice *pci_nic_init_nofail(NICInfo *nd, PCIBus *rootbus, * a temporary instance here to be able to check it. */ Object *obj = object_new_with_class(OBJECT_CLASS(dc)); - if (object_property_find(obj, "netdev", NULL)) { + if (object_property_find(obj, "netdev")) { g_ptr_array_add(pci_nic_models, (gpointer)name); } object_unref(obj); |