Skip to content

Commit c0b3242

Browse files
MarcondiroFabiano Rosas
authored andcommitted
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: 65cf200 ("migration: introduce a QIOChannel impl for BlockDriverState VMState") Signed-off-by: Marco Cavenati <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Reviewed-by: Michael Tokarev <[email protected]> Message-ID: <[email protected]> Signed-off-by: Fabiano Rosas <[email protected]>
1 parent 0f15892 commit c0b3242

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

migration/channel-block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ qio_channel_block_seek(QIOChannel *ioc,
123123
bioc->offset = offset;
124124
break;
125125
case SEEK_CUR:
126-
bioc->offset += whence;
126+
bioc->offset += offset;
127127
break;
128128
case SEEK_END:
129129
error_setg(errp, "Size of VMstate region is unknown");

0 commit comments

Comments
 (0)