]> Git Repo - qemu.git/commitdiff
qom: Improve error message displayed with missing object properties
authorPhilippe Mathieu-Daudé <[email protected]>
Sun, 20 Sep 2020 15:53:40 +0000 (17:53 +0200)
committerEduardo Habkost <[email protected]>
Tue, 6 Oct 2020 15:09:35 +0000 (11:09 -0400)
Instead of only displaying the property missing, also display
the object name. This help developer to quickly figure out the
mistake without opening a debugger.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Li Qiang <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Message-Id: <20200920155340[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
qom/object.c

index c335dce7e4a466eb5f3f3c949d977dd0f48769aa..10653552334549241cd5672d7a027ad57432c482 100644 (file)
@@ -1291,7 +1291,8 @@ ObjectProperty *object_property_find_err(Object *obj, const char *name,
 {
     ObjectProperty *prop = object_property_find(obj, name);
     if (!prop) {
-        error_setg(errp, "Property '.%s' not found", name);
+        error_setg(errp, "Property '%s.%s' not found",
+                   object_get_typename(obj), name);
     }
     return prop;
 }
This page took 0.029652 seconds and 4 git commands to generate.