From nobody Tue Feb 10 04:15:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.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=nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1685647798; cv=none; d=zohomail.com; s=zohoarc; b=JwxXMccaMDDMmtut0+zUVqlP8Nim/R8Qk1Qe0Dpd+81/ti3vwiGVvNvnYnUKGkbny81EI4CLfAn3sKayBJRrn790BdjdMWEGm6cgw0XWGQ8NsnjjOUeL/DqbhhFEWVOFyQffGj49jCC4ACtbtmM5lK0qWySitvnvkPuAxv0q36Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685647798; 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:Reply-To:References:Sender:Subject:To; bh=9anG3Rb3/R7wVK/QtKsv8I34QsnvkVUghxhHuuy2fPA=; b=Egg7PQnGkA06cwiAFfr7tuislRVl7b6goVv+a4zsRkxskkiO6V/3Z4mbRwDQrL1GeL7vr9785LI+S1h5mQCbqCIkxYz+QWb+vjFxV3zfNZHoltyHLOdK8CSDVkU8DVFpliXeArGcH/+eGPBAV0HzeAUGfuLjWKt6qQl+vWwj4yA= ARC-Authentication-Results: i=1; mx.zohomail.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 1685647798376572.053147435482; Thu, 1 Jun 2023 12:29:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4nyh-0006mQ-9k; Thu, 01 Jun 2023 15:28:55 -0400 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 1q4nyY-0006jh-NT; Thu, 01 Jun 2023 15:28:46 -0400 Received: from relay.virtuozzo.com ([130.117.225.111]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4nyV-0005mB-RE; Thu, 01 Jun 2023 15:28:46 -0400 Received: from dev005.ch-qa.vzint.dev ([172.29.1.10]) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1q4nyC-00DLDg-0s; Thu, 01 Jun 2023 21:28:36 +0200 To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, kwolf@redhat.com, hreitz@redhat.com, andrey.drobyshev@virtuozzo.com, den@virtuozzo.com Subject: [PATCH 3/6] qemu-img: rebase: use backing files' BlockBackend for buffer alignment Date: Thu, 1 Jun 2023 22:28:33 +0300 Message-Id: <20230601192836.598602-4-andrey.drobyshev@virtuozzo.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230601192836.598602-1-andrey.drobyshev@virtuozzo.com> References: <20230601192836.598602-1-andrey.drobyshev@virtuozzo.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=130.117.225.111; envelope-from=andrey.drobyshev@virtuozzo.com; helo=relay.virtuozzo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, 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: , Reply-to: Andrey Drobyshev From: Andrey Drobyshev via Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1685647799235100002 Content-Type: text/plain; charset="utf-8" Since commit bb1c05973cf ("qemu-img: Use qemu_blockalign"), buffers for the data read from the old and new backing files are aligned using BlockDriverState (or BlockBackend later on) referring to the target image. However, this isn't quite right, because target image is only being written to and has nothing to do with those buffers. Let's fix that. Signed-off-by: Andrey Drobyshev Reviewed-by: Denis V. Lunev --- qemu-img.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 78433f3746..60f4c06487 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3746,8 +3746,8 @@ static int img_rebase(int argc, char **argv) int64_t n; float local_progress =3D 0; =20 - buf_old =3D blk_blockalign(blk, IO_BUF_SIZE); - buf_new =3D blk_blockalign(blk, IO_BUF_SIZE); + buf_old =3D blk_blockalign(blk_old_backing, IO_BUF_SIZE); + buf_new =3D blk_blockalign(blk_new_backing, IO_BUF_SIZE); =20 size =3D blk_getlength(blk); if (size < 0) { --=20 2.31.1