From nobody Wed Apr 2 13:47:04 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@eurecom.fr; 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=fail(p=none dis=none) header.from=eurecom.fr Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1743007254340516.0051417333365; Wed, 26 Mar 2025 09:40:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1txTnK-00005u-QJ; Wed, 26 Mar 2025 12:39:58 -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 1txTXO-0005kT-4E; Wed, 26 Mar 2025 12:23:30 -0400 Received: from smtp.eurecom.fr ([193.55.113.210]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1txTXI-00042J-AP; Wed, 26 Mar 2025 12:23:29 -0400 Received: from waha.eurecom.fr (HELO smtps.eurecom.fr) ([10.3.2.236]) by drago1i.eurecom.fr with ESMTP; 26 Mar 2025 17:23:19 +0100 Received: from marco-eurecom-desktop.s3.eurecom.fr (unknown [193.55.114.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtps.eurecom.fr (Postfix) with ESMTPSA id F11D027CF; Wed, 26 Mar 2025 17:23:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=eurecom.fr; i=@eurecom.fr; q=dns/txt; s=default; t=1743006204; x=1774542204; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ib5IvQ3tvyGQ/iuonjN8bNwSr8FqBwTNLajh/EN271E=; b=S3vFjzJzJXdqy/23e9UfQ8iSBDMHcnO8RxalXsWA6pkn4dA6gf/aEoiP wv/WDSK5d+1onWAN50PTnXOTwJfwOAfn48Yr9xziCNk6XPwslUrJ98Sht 5B+n83JbH3E/DXuSw07nPqKdcfmP3Del1BwEQCq3G87pQyHex+iiM1DNX o=; X-CSE-ConnectionGUID: +wusofiwQ2ySHDERDtzK8Q== X-CSE-MsgGUID: 4yUF5vo4R0Gwuh1tm1NJGA== X-IronPort-AV: E=Sophos;i="6.14,278,1736809200"; d="scan'208";a="547941" From: Marco Cavenati To: Peter Xu , Fabiano Rosas Cc: qemu-devel@nongnu.org, Marco Cavenati , qemu-trivial@nongnu.org Subject: [PATCH] migration: fix SEEK_CUR offset calculation in qio_channel_block_seek Date: Wed, 26 Mar 2025 17:22:30 +0100 Message-ID: <20250326162230.3323199-1-Marco.Cavenati@eurecom.fr> X-Mailer: git-send-email 2.43.0 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=193.55.113.210; envelope-from=Marco.Cavenati@eurecom.fr; helo=smtp.eurecom.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 26 Mar 2025 12:39:54 -0400 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: fail (Header signature does not verify) X-ZM-MESSAGEID: 1743007259818019100 Content-Type: text/plain; charset="utf-8" The SEEK_CUR case in qio_channel_block_seek was incorrectly using the 'whence' parameter instead of the 'offset' parameter when calculating the new position. Fixes: 65cf200a51ddc6d0a28ecceac30dc892233cddd7 ("migration: introduce a QI= OChannel impl for BlockDriverState VMState") Signed-off-by: Marco Cavenati Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michael Tokarev --- migration/channel-block.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migration/channel-block.c b/migration/channel-block.c index fff8d87094..b0477f5b6d 100644 --- a/migration/channel-block.c +++ b/migration/channel-block.c @@ -123,7 +123,7 @@ qio_channel_block_seek(QIOChannel *ioc, bioc->offset =3D offset; break; case SEEK_CUR: - bioc->offset +=3D whence; + bioc->offset +=3D offset; break; case SEEK_END: error_setg(errp, "Size of VMstate region is unknown"); --=20 2.43.0