[PATCH 20/20] qom: Remove error prefix check at object_property_parse()

Eduardo Habkost posted 20 patches 5 years, 3 months ago
Maintainers: Thomas Huth <thuth@redhat.com>, Christian Borntraeger <borntraeger@de.ibm.com>, Markus Armbruster <armbru@redhat.com>, Xiao Guangrong <xiaoguangrong.eric@gmail.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Jason Wang <jasowang@redhat.com>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, Richard Henderson <rth@twiddle.net>, Halil Pasic <pasic@linux.ibm.com>, David Hildenbrand <david@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Li Zhijian <lizhijian@cn.fujitsu.com>, "Michael S. Tsirkin" <mst@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Zhang Chen <chen.zhang@intel.com>
[PATCH 20/20] qom: Remove error prefix check at object_property_parse()
Posted by Eduardo Habkost 5 years, 3 months ago
All existing "Property '<TYPE>.<PROP>' ..." error messages were
rewritten, we can now add the error message prefix unconditionally.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org
---
 qom/object.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index 6fb1657724..4fc536716c 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1640,14 +1640,8 @@ bool object_property_parse(Object *obj, const char *name,
     bool ok = object_property_set(obj, name, v, errp);
 
     if (!ok) {
-        /*
-         * Temporary check for existing prefix, until all error reporting
-         * functions remove their own prefix.
-         */
-        if (!g_str_has_prefix(error_get_pretty(*errp), "Property '")) {
-            error_prepend(errp, "Property '%s.%s' can't take value '%s': ",
-                        object_get_typename(obj), name, string);
-        }
+        error_prepend(errp, "Property '%s.%s' can't take value '%s': ",
+                      object_get_typename(obj), name, string);
     }
     visit_free(v);
     return ok;
-- 
2.28.0