On Thu, 27 Mar 2025 at 20:03, Marco Cavenati <marco.caven...@eurecom.fr> 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. > > migration/channel-block.c | 48 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > > +++ 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); >
* IIUC, when _FEATURE_SEEKABLE is set, the channel I/O sequence eventually makes underlying preadv(2)/pwritev(2) calls, which use lseek(2) to adjust the stream r/w pointer with the given offset, before doing the r/w operation. * QIOChannelBlock has '.io_seek' routine corresponding to the lseek(2) call. It is not clear how setting QIO_CHANNEL_FEATURE_SEEKABLE helps for QIOChannelBlock streams. Thank you. --- - Prasad