Hello,

On Monday, April 07, 2025 08:47 CEST, Prasad Pandit <ppan...@redhat.com> wrote:

> * If seeking is managed internally by pread(2)/pwrite(2) and co.
> functions, then that is independent of the
> 'QIO_CHANNEL_FEATURE_SEEKABLE' flag; This flag is QEMU specific, it is
> not available outside of QEMU/io/ system. pread(2)/pwrite(2) are
> standard C library functions.

> * Another question is: will pread(2)/pwrite(2) functions work the same
> if we don't set the 'QIO_CHANNEL_FEATURE_SEEKABLE' flag?
>
> (what I'm trying to say is: it is not clear how setting
> '*_FEATURE_SEEKABLE'  flag helps in case of QIOChannelBlock class)

As you said the capability is used internally. Its goal is to signal to
other QEMU code that the QIOChannel is seekable.
'qio_channel_pwritev' and 'qio_channel_preadv' can be used only if
the QIOChannel has the 'QIO_CHANNEL_FEATURE_SEEKABLE' 
capability.

The mapped-ram migration checks if the channel has this capability
because it uses the aforementioned functions. Without the capability 
and the functions implemented in this patch, the mapped-ram migration
won't work with QIOChannelBlock.

You can have a look at the patch where those functions were
introduced here [0].

Best,
Marco

[0] https://lore.kernel.org/qemu-devel/20240229153017.2221-4-faro...@suse.de/


Reply via email to