From: Fabiano Rosas <farosas@suse.de>
To: Michael Tokarev <mjt@tls.msk.ru>,
Marco Cavenati <Marco.Cavenati@eurecom.fr>,
Peter Xu <peterx@redhat.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: Re: [PATCH] migration: fix SEEK_CUR offset calculation in qio_channel_block_seek
Date: Mon, 31 Mar 2025 09:26:44 -0300 [thread overview]
Message-ID: <871pudmlmj.fsf@suse.de> (raw)
In-Reply-To: <a5f19b09-f222-4747-8b52-b2fd67a6832e@tls.msk.ru>
Michael Tokarev <mjt@tls.msk.ru> writes:
> 26.03.2025 19:22, Marco Cavenati wrote:
>> 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");
>
> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
>
> This is a (trivial) bugfix, I'd say it should be in 10.0.
> Will you guys send a pullreq for the block layer, or should
> I make a single-patch pullreq from the trivial tree?
I'll take it. It's not entirely trivial as it shifts a value by 1 in
mapped-ram migration. Fortunately, it's a value that doesn't need to be
the same between migration source and destination.
Thanks
>
> Thanks,
>
> /mjt
next prev parent reply other threads:[~2025-03-31 12:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871pudmlmj.fsf@suse.de \
--to=farosas@suse.de \
--cc=Marco.Cavenati@eurecom.fr \
--cc=mjt@tls.msk.ru \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).