Message ID | 20231127202612.23012-8-farosas@suse.de |
---|---|
State | New |
Headers | show |
Series | migration: File based migration with multifd and fixed-ram | expand |
On Mon, Nov 27, 2023 at 05:25:49PM -0300, Fabiano Rosas wrote: > The fixed-ram migration format needs a channel that supports seeking > to be able to write each page to an arbitrary offset in the migration > stream. > > Signed-off-by: Fabiano Rosas <farosas@suse.de> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> > --- > - avoided overwriting errp in compatibility check > --- > migration/migration.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/migration/migration.c b/migration/migration.c > index 28a34c9068..897ed1db67 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -135,10 +135,26 @@ static bool transport_supports_multi_channels(SocketAddress *saddr) > saddr->type == SOCKET_ADDRESS_TYPE_VSOCK; > } > > +static bool migration_needs_seekable_channel(void) > +{ > + return migrate_fixed_ram(); > +} > + > +static bool transport_supports_seeking(MigrationAddress *addr) > +{ > + return addr->transport == MIGRATION_ADDRESS_TYPE_FILE; > +} What about TYPE_FD? Is it going to be supported later? > + > static bool > migration_channels_and_transport_compatible(MigrationAddress *addr, > Error **errp) > { > + if (migration_needs_seekable_channel() && > + !transport_supports_seeking(addr)) { > + error_setg(errp, "Migration requires seekable transport (e.g. file)"); > + return false; > + } > + > if (migration_needs_multiple_sockets() && > (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) && > !transport_supports_multi_channels(&addr->u.socket)) { > -- > 2.35.3 >
Peter Xu <peterx@redhat.com> writes: > On Mon, Nov 27, 2023 at 05:25:49PM -0300, Fabiano Rosas wrote: >> The fixed-ram migration format needs a channel that supports seeking >> to be able to write each page to an arbitrary offset in the migration >> stream. >> >> Signed-off-by: Fabiano Rosas <farosas@suse.de> >> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> >> --- >> - avoided overwriting errp in compatibility check >> --- >> migration/migration.c | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) >> >> diff --git a/migration/migration.c b/migration/migration.c >> index 28a34c9068..897ed1db67 100644 >> --- a/migration/migration.c >> +++ b/migration/migration.c >> @@ -135,10 +135,26 @@ static bool transport_supports_multi_channels(SocketAddress *saddr) >> saddr->type == SOCKET_ADDRESS_TYPE_VSOCK; >> } >> >> +static bool migration_needs_seekable_channel(void) >> +{ >> + return migrate_fixed_ram(); >> +} >> + >> +static bool transport_supports_seeking(MigrationAddress *addr) >> +{ >> + return addr->transport == MIGRATION_ADDRESS_TYPE_FILE; >> +} > > What about TYPE_FD? Is it going to be supported later? > nSorry, I missed this one. Yes, and thanks for asking because I just remembered I have code for this lost in a git stash somewhere. I'll include it in v4. >> + >> static bool >> migration_channels_and_transport_compatible(MigrationAddress *addr, >> Error **errp) >> { >> + if (migration_needs_seekable_channel() && >> + !transport_supports_seeking(addr)) { >> + error_setg(errp, "Migration requires seekable transport (e.g. file)"); >> + return false; >> + } >> + >> if (migration_needs_multiple_sockets() && >> (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) && >> !transport_supports_multi_channels(&addr->u.socket)) { >> -- >> 2.35.3 >>
Peter Xu <peterx@redhat.com> writes: > On Mon, Nov 27, 2023 at 05:25:49PM -0300, Fabiano Rosas wrote: >> The fixed-ram migration format needs a channel that supports seeking >> to be able to write each page to an arbitrary offset in the migration >> stream. >> >> Signed-off-by: Fabiano Rosas <farosas@suse.de> >> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> >> --- >> - avoided overwriting errp in compatibility check >> --- >> migration/migration.c | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) >> >> diff --git a/migration/migration.c b/migration/migration.c >> index 28a34c9068..897ed1db67 100644 >> --- a/migration/migration.c >> +++ b/migration/migration.c >> @@ -135,10 +135,26 @@ static bool transport_supports_multi_channels(SocketAddress *saddr) >> saddr->type == SOCKET_ADDRESS_TYPE_VSOCK; >> } >> >> +static bool migration_needs_seekable_channel(void) >> +{ >> + return migrate_fixed_ram(); >> +} >> + >> +static bool transport_supports_seeking(MigrationAddress *addr) >> +{ >> + return addr->transport == MIGRATION_ADDRESS_TYPE_FILE; >> +} > > What about TYPE_FD? Is it going to be supported later? > Sorry, I missed this one. Yes, and thanks for asking because I just remembered I have code for this lost in a git stash somewhere. I'll include it in v4. >> + >> static bool >> migration_channels_and_transport_compatible(MigrationAddress *addr, >> Error **errp) >> { >> + if (migration_needs_seekable_channel() && >> + !transport_supports_seeking(addr)) { >> + error_setg(errp, "Migration requires seekable transport (e.g. file)"); >> + return false; >> + } >> + >> if (migration_needs_multiple_sockets() && >> (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) && >> !transport_supports_multi_channels(&addr->u.socket)) { >> -- >> 2.35.3 >>
diff --git a/migration/migration.c b/migration/migration.c index 28a34c9068..897ed1db67 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -135,10 +135,26 @@ static bool transport_supports_multi_channels(SocketAddress *saddr) saddr->type == SOCKET_ADDRESS_TYPE_VSOCK; } +static bool migration_needs_seekable_channel(void) +{ + return migrate_fixed_ram(); +} + +static bool transport_supports_seeking(MigrationAddress *addr) +{ + return addr->transport == MIGRATION_ADDRESS_TYPE_FILE; +} + static bool migration_channels_and_transport_compatible(MigrationAddress *addr, Error **errp) { + if (migration_needs_seekable_channel() && + !transport_supports_seeking(addr)) { + error_setg(errp, "Migration requires seekable transport (e.g. file)"); + return false; + } + if (migration_needs_multiple_sockets() && (addr->transport == MIGRATION_ADDRESS_TYPE_SOCKET) && !transport_supports_multi_channels(&addr->u.socket)) {