From nobody Tue Nov 26 09:39:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1709178038; cv=none; d=zohomail.com; s=zohoarc; b=ATdEsd8GaDluz4ByKMVuuSFAVVEfCd/xih29IiYRsIIiTZvVsBnFLZ39nfHzFbBq59exJ59X9PDbODmfudWC/W2QYmGZo2zw4sLjs1ULr8SJzRAGmahl+puLkMj4jKuWuV64KGK7PfhWuPnu1uHIaeISARnDYEIF+mYszqbMe3Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709178038; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WsG2BwSbGqf2qU4G4HNlljgDwKOgjhJssRNwqUAHwSM=; b=MQFtUVVm+GKm5QomnOccF/TNxmXdbH0bgJiIO+rIlWUQis/Hmrmzz1jSybAzsFceyFM/nCsQDGHd976vbC4XFHpL8FJC0KsfcSIvNLp6U3VP+OicoZnLp/6kdd0B/lwGuWX4hAWwa6ZS6Ue+P3JSRmRYbki7g3DLYhuGTDTsrHk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17091780386651006.302336482845; Wed, 28 Feb 2024 19:40:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfXGy-000892-IB; Wed, 28 Feb 2024 22:39:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfXGw-00088H-Nj for qemu-devel@nongnu.org; Wed, 28 Feb 2024 22:39:50 -0500 Received: from mgamail.intel.com ([198.175.65.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfXGv-0001yM-2l for qemu-devel@nongnu.org; Wed, 28 Feb 2024 22:39:50 -0500 Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 19:39:45 -0800 Received: from spr-s2600bt.bj.intel.com ([10.240.192.124]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 19:39:44 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709177989; x=1740713989; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p6QH4TugmX7PtxN3cuvjGcehp8Eor7bXsS9qNgtb5A4=; b=PZvYZDWCUPYjoWdPUwt53IW4RRHGA1HDTmtw6jdr8v39WuhSyRgFlz3J 5kbZIoibC8+kJgIYWVagCggzMzdr5Q6hZdsBN36oCmPZMFqKIPqaaifHt NV8l+R16WCJhJ6MKBATqi7Ht4js+o6NLgDvawIaaID8d4pzYm62/J2Pz3 RYBDQkMpKurF/OwM07oPKo9fvPpFgK6UsINZcsATjm2ld5tW6Fr3Rpj+g IDr2PcuJkcjlS/cgZoB7RpZp0sRN8/AE+/0yb6Uyd1XJygc8+uaxqYrR6 RfAqAMxzKhP45q2g+SpFjteaZ2RdxP6Z/0we9Tg5Dt7lbGqMiL/c6gMS+ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="21082854" X-IronPort-AV: E=Sophos;i="6.06,192,1705392000"; d="scan'208";a="21082854" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,192,1705392000"; d="scan'208";a="7592533" From: Zhenzhong Duan To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, berrange@redhat.com, eduardo@habkost.net, chao.p.peng@intel.com, Zhenzhong Duan Subject: [PATCH 2/2] qom/object_interfaces: Remove local_err in user_creatable_add_type Date: Thu, 29 Feb 2024 11:37:39 +0800 Message-Id: <20240229033739.1123076-3-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240229033739.1123076-1-zhenzhong.duan@intel.com> References: <20240229033739.1123076-1-zhenzhong.duan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=198.175.65.10; envelope-from=zhenzhong.duan@intel.com; helo=mgamail.intel.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.102, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1709178039288100001 Content-Type: text/plain; charset="utf-8" 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 has ERRP_GUARD, remove local_err and use *errp instead. Signed-off-by: Zhenzhong Duan --- qom/object_interfaces.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c index 255a7bf659..165cd433e7 100644 --- a/qom/object_interfaces.c +++ b/qom/object_interfaces.c @@ -81,7 +81,6 @@ Object *user_creatable_add_type(const char *type, const c= har *id, ERRP_GUARD(); Object *obj; ObjectClass *klass; - Error *local_err =3D NULL; =20 if (id !=3D NULL && !id_wellformed(id)) { error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "id", "an identifie= r"); @@ -109,20 +108,20 @@ Object *user_creatable_add_type(const char *type, con= st char *id, =20 assert(qdict); obj =3D object_new(type); - object_set_properties_from_qdict(obj, qdict, v, &local_err); - if (local_err) { + object_set_properties_from_qdict(obj, qdict, v, errp); + if (*errp) { goto out; } =20 if (id !=3D NULL) { object_property_try_add_child(object_get_objects_root(), - id, obj, &local_err); - if (local_err) { + id, obj, errp); + if (*errp) { goto out; } } =20 - if (!user_creatable_complete(USER_CREATABLE(obj), &local_err)) { + if (!user_creatable_complete(USER_CREATABLE(obj), errp)) { if (id !=3D NULL) { object_property_del(object_get_objects_root(), id); } @@ -130,7 +129,6 @@ Object *user_creatable_add_type(const char *type, const= char *id, } return obj; out: - error_propagate(errp, local_err); object_unref(obj); return NULL; } --=20 2.34.1