From d34c201195ecea4fa5c3328a8f5507ca6d2c0a96 Mon Sep 17 00:00:00 2001 From: Marco Cavenati Date: Wed, 26 Mar 2025 17:22:30 +0100 Subject: [PATCH] migration: fix SEEK_CUR offset calculation in qio_channel_block_seek MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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: 65cf200a51 ("migration: introduce a QIOChannel impl for BlockDriverState VMState") Signed-off-by: Marco Cavenati Reviewed-by: Daniel P. Berrangé Reviewed-by: Michael Tokarev Message-ID: <20250326162230.3323199-1-Marco.Cavenati@eurecom.fr> Signed-off-by: Fabiano Rosas (cherry picked from commit c0b32426ce56182c1ce2a12904f3a702c2ecc460) Signed-off-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 f4ab53acdb..81ec5c6ac6 100644 --- a/migration/channel-block.c +++ b/migration/channel-block.c @@ -122,7 +122,7 @@ qio_channel_block_seek(QIOChannel *ioc, bioc->offset = offset; break; case SEEK_CUR: - bioc->offset += whence; + bioc->offset += offset; break; case SEEK_END: error_setg(errp, "Size of VMstate region is unknown"); -- 2.39.5