From: Marco Cavenati Date: Wed, 26 Mar 2025 16:22:30 +0000 (+0100) Subject: migration: fix SEEK_CUR offset calculation in qio_channel_block_seek X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=49d8a107424c2fdde69d932164d6370854f5d7fc;p=thirdparty%2Fqemu.git migration: fix SEEK_CUR offset calculation in qio_channel_block_seek 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 --- 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 = offset; break; case SEEK_CUR: - bioc->offset += whence; + bioc->offset += offset; break; case SEEK_END: error_setg(errp, "Size of VMstate region is unknown");