From nobody Fri May 3 00:56:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488548429365371.57115952241213; Fri, 3 Mar 2017 05:40:29 -0800 (PST) Received: from localhost ([::1]:58134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnRZ-0000dU-VE for importer@patchew.org; Fri, 03 Mar 2017 08:40:26 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnPh-0008DZ-I8 for qemu-devel@nongnu.org; Fri, 03 Mar 2017 08:38:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjnPg-0001C0-LR for qemu-devel@nongnu.org; Fri, 03 Mar 2017 08:38:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36606) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cjnPc-0001AN-TT; Fri, 03 Mar 2017 08:38:25 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B87D4DD44; Fri, 3 Mar 2017 13:38:25 +0000 (UTC) Received: from lemon.redhat.com (ovpn-8-27.pek2.redhat.com [10.72.8.27]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v23DcImb021849; Fri, 3 Mar 2017 08:38:22 -0500 From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 3 Mar 2017 21:38:15 +0800 Message-Id: <20170303133816.30303-2-famz@redhat.com> In-Reply-To: <20170303133816.30303-1-famz@redhat.com> References: <20170303133816.30303-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 03 Mar 2017 13:38:25 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] block: Don't use error_abort in blk_new_open X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Jeff Cody , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We have an errp and bdrv_root_attach_child can fail permission check, error_abort is not the best choice here. Signed-off-by: Fam Zheng Reviewed-by: Eric Blake --- block/block-backend.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/block/block-backend.c b/block/block-backend.c index daa7908..4eab68f 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -213,7 +213,11 @@ BlockBackend *blk_new_open(const char *filename, const= char *reference, } =20 blk->root =3D bdrv_root_attach_child(bs, "root", &child_root, - perm, BLK_PERM_ALL, blk, &error_abo= rt); + perm, BLK_PERM_ALL, blk, errp); + if (!blk->root) { + blk_unref(blk); + return NULL; + } =20 return blk; } --=20 2.9.3 From nobody Fri May 3 00:56:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 148854836674725.308924295086854; Fri, 3 Mar 2017 05:39:26 -0800 (PST) Received: from localhost ([::1]:58129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnQb-0008Ji-30 for importer@patchew.org; Fri, 03 Mar 2017 08:39:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjnPi-0008Et-Mb for qemu-devel@nongnu.org; Fri, 03 Mar 2017 08:38:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjnPh-0001DR-V6 for qemu-devel@nongnu.org; Fri, 03 Mar 2017 08:38:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53404) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cjnPf-0001BE-Og; Fri, 03 Mar 2017 08:38:27 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9F3E2E6041; Fri, 3 Mar 2017 13:38:27 +0000 (UTC) Received: from lemon.redhat.com (ovpn-8-27.pek2.redhat.com [10.72.8.27]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v23DcImc021849; Fri, 3 Mar 2017 08:38:25 -0500 From: Fam Zheng To: qemu-devel@nongnu.org Date: Fri, 3 Mar 2017 21:38:16 +0800 Message-Id: <20170303133816.30303-3-famz@redhat.com> In-Reply-To: <20170303133816.30303-1-famz@redhat.com> References: <20170303133816.30303-1-famz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 03 Mar 2017 13:38:27 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/2] commit: Don't use error_abort in commit_start X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Jeff Cody , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" bdrv_set_backing_hd failure needn't be abort. Since we already have error parameter, use it. Signed-off-by: Fam Zheng Reviewed-by: Eric Blake --- block/commit.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/block/commit.c b/block/commit.c index 22a0a4d..1be19e1 100644 --- a/block/commit.c +++ b/block/commit.c @@ -316,8 +316,16 @@ void commit_start(const char *job_id, BlockDriverState= *bs, goto fail; } =20 - bdrv_set_backing_hd(commit_top_bs, top, &error_abort); - bdrv_set_backing_hd(overlay_bs, commit_top_bs, &error_abort); + bdrv_set_backing_hd(commit_top_bs, top, &local_err); + if (local_err) { + error_propagate(errp, local_err); + goto fail; + } + bdrv_set_backing_hd(overlay_bs, commit_top_bs, &local_err); + if (local_err) { + error_propagate(errp, local_err); + goto fail; + } =20 s->commit_top_bs =3D commit_top_bs; bdrv_unref(commit_top_bs); --=20 2.9.3