qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] migration: fix SEEK_CUR offset calculation in qio_channel_block_seek
@ 2025-03-26 16:22 Marco Cavenati
  2025-03-26 16:48 ` Daniel P. Berrangé
  2025-03-29  5:41 ` Michael Tokarev
  0 siblings, 2 replies; 12+ messages in thread
From: Marco Cavenati @ 2025-03-26 16:22 UTC (permalink / raw)
  To: Peter Xu, Fabiano Rosas; +Cc: qemu-devel, Marco Cavenati, qemu-trivial

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 QIOChannel impl for BlockDriverState VMState")

Signed-off-by: Marco Cavenati <Marco.Cavenati@eurecom.fr>
---
 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 = 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.43.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-08-30 15:34 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-26 16:22 [PATCH] migration: fix SEEK_CUR offset calculation in qio_channel_block_seek Marco Cavenati
2025-03-26 16:48 ` Daniel P. Berrangé
2025-03-29  5:41 ` Michael Tokarev
2025-03-31 12:26   ` Fabiano Rosas
2025-08-26 20:32     ` Michael Tokarev
2025-08-26 21:27       ` Peter Xu
2025-08-26 21:52       ` Fabiano Rosas
2025-08-27  6:59         ` [PATCH] virtio: Call set_features during reset (was: migration: fix SEEK_CUR offset calculation in qio_channel_block_seek) Michael Tokarev
2025-08-28  0:57         ` [PATCH] migration: fix SEEK_CUR offset calculation in qio_channel_block_seek Akihiko Odaki
2025-08-29  8:34           ` [PATCH] virtio: Call set_features during reset Michael Tokarev
2025-08-29 14:40             ` Akihiko Odaki
2025-08-29 15:14               ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).