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 <Marco.Cavenati@eurecom.fr> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Message-ID: <20250326162230.3323199-1-Marco.Cavenati@eurecom.fr> Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
parent
0f15892aca
commit
c0b32426ce
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user