From nobody Sun Feb 8 17:13:15 2026 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; dkim=fail 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 1497620383239608.6376522383127; Fri, 16 Jun 2017 06:39:43 -0700 (PDT) Received: from localhost ([::1]:58943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLrTR-0006Ga-Ib for importer@patchew.org; Fri, 16 Jun 2017 09:39:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLrRd-00051f-CM for qemu-devel@nongnu.org; Fri, 16 Jun 2017 09:37:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLrRY-0000gH-F8 for qemu-devel@nongnu.org; Fri, 16 Jun 2017 09:37:49 -0400 Received: from fanzine.igalia.com ([91.117.99.155]:35105) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dLrRX-0000eH-VB; Fri, 16 Jun 2017 09:37:44 -0400 Received: from [194.100.51.2] (helo=perseus.local) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1dLrRU-0003tG-T4; Fri, 16 Jun 2017 15:37:41 +0200 Received: from berto by perseus.local with local (Exim 4.89) (envelope-from ) id 1dLrRD-00018v-3F; Fri, 16 Jun 2017 16:37:23 +0300 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=References:In-Reply-To:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=T1Qp8CjRCR/K9SRw8VNuVCHPXjuSZ6FWvb71Bif3lWI=; b=L5CAbD33Mf939sT3w1LgoLDpSWcoxfRSGahbgO1HDFJKIWe/yIuIv5lkRUXPAnHpanP6v6clyp3BbvBwShAveNckL/udL4PpuwDoiL+HI5cHRsEWbRZctorC8LAy0nOrkwM8zLXd1l31xFOwARrXoPCoiFQSg20PBN0MkQ0XzWsl8eFOalXfYhTHympgkZoVPD0zpiMW9kgbGeB3qpP0fpuEcJaARSCbPq2AJI3c0/S5OwKHKklAPoRaic5U2PFM+3xxd0lrbhlPM3oPZhk9Je0QyNH7I4Qi0oreycXLTZbcsoNEfOGVCLcSh5fO/GAiNlHb1NGuRRnmectDXpfYeg==; From: Alberto Garcia To: qemu-devel@nongnu.org Date: Fri, 16 Jun 2017 16:37:01 +0300 Message-Id: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Received-From: 91.117.99.155 Subject: [Qemu-devel] [PATCH v3 1/7] qcow2: Remove unused Error variable in do_perform_cow() 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 , Alberto Garcia , qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi , "Denis V . Lunev" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We are using the return value of qcow2_encrypt_sectors() to detect problems but we are throwing away the returned Error since we have no way to report it to the user. Therefore we can simply get rid of the local Error variable and pass NULL instead. Alternatively we could try to figure out a way to pass the original error instead of simply returning -EIO, but that would be more invasive, so let's keep the current approach. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- block/qcow2-cluster.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c index d779ea19cf..d1c419f52b 100644 --- a/block/qcow2-cluster.c +++ b/block/qcow2-cluster.c @@ -440,16 +440,14 @@ static int coroutine_fn do_perform_cow(BlockDriverSta= te *bs, } =20 if (bs->encrypted) { - Error *err =3D NULL; int64_t sector =3D (src_cluster_offset + offset_in_cluster) >> BDRV_SECTOR_BITS; assert(s->cipher); assert((offset_in_cluster & ~BDRV_SECTOR_MASK) =3D=3D 0); assert((bytes & ~BDRV_SECTOR_MASK) =3D=3D 0); if (qcow2_encrypt_sectors(s, sector, iov.iov_base, iov.iov_base, - bytes >> BDRV_SECTOR_BITS, true, &err) <= 0) { + bytes >> BDRV_SECTOR_BITS, true, NULL) <= 0) { ret =3D -EIO; - error_free(err); goto out; } } --=20 2.11.0