From nobody Mon Feb 9 01:20:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1569357104; cv=none; d=zoho.com; s=zohoarc; b=SStnA4h0WdAm7r4qhDPf66tCXfQKSowHDnCK5rVI4ACFMjA+ne2JUIm14B6knzjc2yW9hU47qgkFXVY0NuaZjPw+Od6XtGvA/cpmB2Z5Q0ALWJp4w0Ljz+ev/8K5BTbRJrG3/p6MXnFOw1Hlpk/CmNssyx+QyE6V1kBeikO+3W4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569357104; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=aKIwOZCXvR+DeUhUi0zcN+omZdKyZ7Duwr5CskaVLJM=; b=PRcAZSzoGKt1RKXthf64JzcVSF9ovoaC2zuVAKX8DVpt/WuYeIAbub2RAEg0OIAYXafUbC1neWTBI3wRqas/rbd3sogiom+ePC1BiLvsFrPi6bavITrA/31kDuRyeAvW0zYctCKe8Xcrz7+pfZ7iMQ2/TL9Ca5jhWgS68PK3lsk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1569357104956112.2735297051255; Tue, 24 Sep 2019 13:31:44 -0700 (PDT) Received: from localhost ([::1]:50784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCrTK-0007Hz-LD for importer@patchew.org; Tue, 24 Sep 2019 16:31:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44131) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCr8Z-0000zm-AN for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCr8W-000397-G1 for qemu-devel@nongnu.org; Tue, 24 Sep 2019 16:10:14 -0400 Received: from relay.sw.ru ([185.231.240.75]:38136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iCr8W-0002u5-8q; Tue, 24 Sep 2019 16:10:12 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iCr8A-0001Mk-JZ; Tue, 24 Sep 2019 23:09:50 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org Subject: [PATCH v3 18/25] block: Fix error_append_hint usage Date: Tue, 24 Sep 2019 23:08:55 +0300 Message-Id: <20190924200902.4703-19-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190924200902.4703-1-vsementsov@virtuozzo.com> References: <20190924200902.4703-1-vsementsov@virtuozzo.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Fam Zheng , vsementsov@virtuozzo.com, qemu-block@nongnu.org, Jeff Cody , Greg Kurz , Max Reitz , integration@gluster.org, John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" If we want append hint to errp, we must use ERRP_FUNCTION_BEGIN macro. Otherwise hint will not be appended in case of errp =3D=3D &fatal_err (program will exit before error_append_hint() call). Fix such cases. This commit (together with its neighbors) was generated by git grep -l 'error_append_hint(errp' | while read f; do \ spatch --sp-file scripts/coccinelle/fix-error_append_hint-usage.cocci \ --in-place $f; done and then ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)" (auto-msg was a file with this commit message) Still, for backporting it may be more comfortable to use only the first command and then do one huge commit. Reported-by: Greg Kurz Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/backup.c | 1 + block/dirty-bitmap.c | 1 + block/file-posix.c | 3 +++ block/gluster.c | 2 ++ block/qcow.c | 1 + block/qcow2.c | 1 + block/vhdx-log.c | 1 + block/vpc.c | 1 + 8 files changed, 11 insertions(+) diff --git a/block/backup.c b/block/backup.c index 763f0d7ff6..8cb0201833 100644 --- a/block/backup.c +++ b/block/backup.c @@ -583,6 +583,7 @@ static const BlockJobDriver backup_job_driver =3D { static int64_t backup_calculate_cluster_size(BlockDriverState *target, Error **errp) { + ERRP_FUNCTION_BEGIN(); int ret; BlockDriverInfo bdi; =20 diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 134e0c9a0c..eba47490ea 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -237,6 +237,7 @@ static bool bdrv_dirty_bitmap_recording(BdrvDirtyBitmap= *bitmap) int bdrv_dirty_bitmap_check(const BdrvDirtyBitmap *bitmap, uint32_t flags, Error **errp) { + ERRP_FUNCTION_BEGIN(); if ((flags & BDRV_BITMAP_BUSY) && bdrv_dirty_bitmap_busy(bitmap)) { error_setg(errp, "Bitmap '%s' is currently in use by another" " operation and cannot be used", bitmap->name); diff --git a/block/file-posix.c b/block/file-posix.c index f12c06de2d..46818fe4fc 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -320,6 +320,7 @@ static bool raw_is_io_aligned(int fd, void *buf, size_t= len) =20 static void raw_probe_alignment(BlockDriverState *bs, int fd, Error **errp) { + ERRP_FUNCTION_BEGIN(); BDRVRawState *s =3D bs->opaque; char *buf; size_t max_align =3D MAX(MAX_BLOCKSIZE, getpagesize()); @@ -817,6 +818,7 @@ static int raw_handle_perm_lock(BlockDriverState *bs, uint64_t new_perm, uint64_t new_shared, Error **errp) { + ERRP_FUNCTION_BEGIN(); BDRVRawState *s =3D bs->opaque; int ret =3D 0; Error *local_err =3D NULL; @@ -2232,6 +2234,7 @@ static int64_t raw_get_allocated_file_size(BlockDrive= rState *bs) static int coroutine_fn raw_co_create(BlockdevCreateOptions *options, Error **errp) { + ERRP_FUNCTION_BEGIN(); BlockdevCreateOptionsFile *file_opts; Error *local_err =3D NULL; int fd; diff --git a/block/gluster.c b/block/gluster.c index 64028b2cba..7023807326 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -419,6 +419,7 @@ out: static struct glfs *qemu_gluster_glfs_init(BlockdevOptionsGluster *gconf, Error **errp) { + ERRP_FUNCTION_BEGIN(); struct glfs *glfs; int ret; int old_errno; @@ -694,6 +695,7 @@ static int qemu_gluster_parse(BlockdevOptionsGluster *g= conf, const char *filename, QDict *options, Error **errp) { + ERRP_FUNCTION_BEGIN(); int ret; if (filename) { ret =3D qemu_gluster_parse_uri(gconf, filename); diff --git a/block/qcow.c b/block/qcow.c index 5bdf72ba33..33a004350b 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -117,6 +117,7 @@ static QemuOptsList qcow_runtime_opts =3D { static int qcow_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { + ERRP_FUNCTION_BEGIN(); BDRVQcowState *s =3D bs->opaque; unsigned int len, i, shift; int ret; diff --git a/block/qcow2.c b/block/qcow2.c index 4d16393e61..d9aac1186d 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1207,6 +1207,7 @@ static int qcow2_update_options(BlockDriverState *bs,= QDict *options, static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { + ERRP_FUNCTION_BEGIN(); BDRVQcow2State *s =3D bs->opaque; unsigned int len, i; int ret =3D 0; diff --git a/block/vhdx-log.c b/block/vhdx-log.c index fdd3a7adc3..24e5efb46c 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -748,6 +748,7 @@ exit: int vhdx_parse_log(BlockDriverState *bs, BDRVVHDXState *s, bool *flushed, Error **errp) { + ERRP_FUNCTION_BEGIN(); int ret =3D 0; VHDXHeader *hdr; VHDXLogSequence logs =3D { 0 }; diff --git a/block/vpc.c b/block/vpc.c index 5cd3890780..b12a2d964a 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -971,6 +971,7 @@ static int calculate_rounded_image_size(BlockdevCreateO= ptionsVpc *vpc_opts, static int coroutine_fn vpc_co_create(BlockdevCreateOptions *opts, Error **errp) { + ERRP_FUNCTION_BEGIN(); BlockdevCreateOptionsVpc *vpc_opts; BlockBackend *blk =3D NULL; BlockDriverState *bs =3D NULL; --=20 2.21.0