qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 3/3] qom/object_interfaces: Remove local_err in user_creatable


From: Zhenzhong Duan
Subject: [PATCH v2 3/3] qom/object_interfaces: Remove local_err in user_creatable_add_type
Date: Mon, 18 Mar 2024 11:32:10 +0800

In user_creatable_add_type, there is mixed usage of ERRP_GUARD and
local_err. This makes error_abort not taking effect in those callee
functions with &local_err passed.

Now that we already use ERRP_GUARD, remove local_err and pass errp.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 qom/object_interfaces.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index e17e2de46d..2067bf2230 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -84,7 +84,6 @@ Object *user_creatable_add_type(const char *type, const char 
*id,
     ERRP_GUARD();
     Object *obj;
     ObjectClass *klass;
-    Error *local_err = NULL;
 
     if (id != NULL && !id_wellformed(id)) {
         error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "id", "an identifier");
@@ -112,16 +111,16 @@ Object *user_creatable_add_type(const char *type, const 
char *id,
 
     assert(qdict);
     obj = object_new(type);
-    if (!object_set_properties_from_qdict(obj, qdict, v, &local_err)) {
+    if (!object_set_properties_from_qdict(obj, qdict, v, errp)) {
         goto err;
     }
 
     if (id != NULL && !object_property_try_add_child(object_get_objects_root(),
-                                                     id, obj, &local_err)) {
+                                                     id, obj, errp)) {
             goto err;
     }
 
-    if (!user_creatable_complete(USER_CREATABLE(obj), &local_err)) {
+    if (!user_creatable_complete(USER_CREATABLE(obj), errp)) {
         if (id != NULL) {
             object_property_del(object_get_objects_root(), id);
         }
@@ -129,7 +128,6 @@ Object *user_creatable_add_type(const char *type, const 
char *id,
     }
     return obj;
 err:
-    error_propagate(errp, local_err);
     object_unref(obj);
     return NULL;
 }
-- 
2.34.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]