From: "Marco Cavenati" <Marco.Cavenati@eurecom.fr>
To: "Juraj Marcin" <jmarcin@redhat.com>
Cc: qemu-devel@nongnu.org, peterx@redhat.com, farosas@suse.de,
ppandit@redhat.com, berrange@redhat.com
Subject: Re: [PATCH 1/3] migration: add FEATURE_SEEKABLE to QIOChannelBlock
Date: Fri, 03 Oct 2025 11:47:37 +0200 [thread overview]
Message-ID: <26358a-68df9b80-a13-40f93b80@130992167> (raw)
In-Reply-To: <72mloahvtgskcdjulsggewy3euoutslvpcx2dnkxijgwkogdg6@6oq3h5tncfl3>
Hi Juraj,
On Thursday, October 02, 2025 16:45 CEST, Juraj Marcin <jmarcin@redhat.com> wrote:
> Hi Marco,
>
> On 2025-10-01 18:18, Marco Cavenati wrote:
> > Enable the use of the mapped-ram migration feature with savevm/loadvm
> > snapshots by adding the QIO_CHANNEL_FEATURE_SEEKABLE feature to
> > QIOChannelBlock. Implement io_preadv and io_pwritev methods to provide
> > positioned I/O capabilities that don't modify the channel's position
> > pointer.
> >
> > Signed-off-by: Marco Cavenati <Marco.Cavenati@eurecom.fr>
> > ---
> > migration/channel-block.c | 48 +++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 48 insertions(+)
> >
> > diff --git a/migration/channel-block.c b/migration/channel-block.c
> > index 97de5a691b..30dcefcd8e 100644
> > --- a/migration/channel-block.c
> > +++ b/migration/channel-block.c
> > @@ -30,6 +30,7 @@ qio_channel_block_new(BlockDriverState *bs)
> > QIOChannelBlock *ioc;
> >
> > ioc = QIO_CHANNEL_BLOCK(object_new(TYPE_QIO_CHANNEL_BLOCK));
> > + qio_channel_set_feature(QIO_CHANNEL(ioc), QIO_CHANNEL_FEATURE_SEEKABLE);
> >
> > bdrv_ref(bs);
> > ioc->bs = bs;
> > @@ -96,6 +97,49 @@ qio_channel_block_writev(QIOChannel *ioc,
> > return qiov.size;
> > }
> >
> > +#ifdef CONFIG_PREADV
>
> I don't think this conditional macro is necessary here. QIOChannelFile
> needs it because it directly uses preadv() syscall which might not be
> available on all systems (see when CONFIG_PREADV is defined below).
>
> config_host_data.set('CONFIG_PREADV', cc.has_function('preadv', prefix: '#include <sys/uio.h>'))
>
> However, bdrv_readv_vmstate() (wrapper of bdrv_co_readv_vmstate())
> should be always available IUUC (it is not conditionally compiled based
> on if preadv() syscall is available).
You are right, thanks for pointing this out, I will remove the macro in the
next iteration.
Just to make sure nothing weird happens without preadv support and without the
macro guard, I compiled QEMU without them and indeed it looks like snapshots
are not supported at all without preadv. savevm/loadvm gracefully fail
independently of mapped-ram on/off.
Best regards,
Marco
next prev parent reply other threads:[~2025-10-03 9:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 16:18 [PATCH 0/3] migration: Add support for mapped-ram with snapshots Marco Cavenati
2025-10-01 16:18 ` [PATCH 1/3] migration: add FEATURE_SEEKABLE to QIOChannelBlock Marco Cavenati
2025-10-02 14:45 ` Juraj Marcin
2025-10-03 9:47 ` Marco Cavenati [this message]
2025-10-01 16:18 ` [PATCH 2/3] migration/ram: fix docs of ram_handle_zero Marco Cavenati
2025-10-02 14:48 ` Juraj Marcin
2025-10-01 16:18 ` [PATCH 3/3] migration: mapped-ram: handle zero pages Marco Cavenati
2025-10-02 8:49 ` Marco Cavenati
2025-10-07 21:11 ` Peter Xu
2025-10-08 9:36 ` Marco Cavenati
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=26358a-68df9b80-a13-40f93b80@130992167 \
--to=marco.cavenati@eurecom.fr \
--cc=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=jmarcin@redhat.com \
--cc=peterx@redhat.com \
--cc=ppandit@redhat.com \
--cc=qemu-devel@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).