Skip to content
  • Daniel P. Berrangé's avatar
    efba1595
    qom: simplify object_find_property / object_class_find_property · efba1595
    Daniel P. Berrangé authored
    
    
    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: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200914135617.1493072-1-berrange@redhat.com>
    Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
    efba1595
    qom: simplify object_find_property / object_class_find_property
    Daniel P. Berrangé authored
    
    
    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: default avatarDaniel P. Berrangé <berrange@redhat.com>
    Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
    Message-Id: <20200914135617.1493072-1-berrange@redhat.com>
    Signed-off-by: default avatarEduardo Habkost <ehabkost@redhat.com>
Loading