Message ID | 20231019192353.31500-5-farosas@suse.de |
---|---|
State | New |
Headers | show |
Series | migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration | expand |
On Thu, Oct 19, 2023 at 04:23:43PM -0300, Fabiano Rosas wrote: > Signed-off-by: Fabiano Rosas <farosas@suse.de> > --- > migration/file.c | 2 +- > migration/file.h | 1 + > migration/migration.c | 6 ++++++ > 3 files changed, 8 insertions(+), 1 deletion(-) Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> assuming it'll be squashed into previous With regards, Daniel
Daniel P. Berrangé <berrange@redhat.com> wrote: > On Thu, Oct 19, 2023 at 04:23:43PM -0300, Fabiano Rosas wrote: >> Signed-off-by: Fabiano Rosas <farosas@suse.de> >> --- >> migration/file.c | 2 +- >> migration/file.h | 1 + >> migration/migration.c | 6 ++++++ >> 3 files changed, 8 insertions(+), 1 deletion(-) > > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> I am assuming this reviewed-by applies to this and previous patches, as I am squashing them, I can't do the "partial"e reviewed-by. > assuming it'll be squashed into previous > > > With regards, > Daniel
diff --git a/migration/file.c b/migration/file.c index cf5b1bf365..ec069ef329 100644 --- a/migration/file.c +++ b/migration/file.c @@ -19,7 +19,7 @@ /* Remove the offset option from @filespec and return it in @offsetp. */ -static int file_parse_offset(char *filespec, uint64_t *offsetp, Error **errp) +int file_parse_offset(char *filespec, uint64_t *offsetp, Error **errp) { char *option = strstr(filespec, OFFSET_OPTION); int ret; diff --git a/migration/file.h b/migration/file.h index 90fa4849e0..3888a57105 100644 --- a/migration/file.h +++ b/migration/file.h @@ -11,4 +11,5 @@ void file_start_incoming_migration(const char *filename, Error **errp); void file_start_outgoing_migration(MigrationState *s, const char *filename, Error **errp); +int file_parse_offset(char *filespec, uint64_t *offsetp, Error **errp); #endif diff --git a/migration/migration.c b/migration/migration.c index c1108f409c..e3608d7f60 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -465,6 +465,12 @@ static bool migrate_uri_parse(const char *uri, } addr->u.socket.type = saddr->type; addr->u.socket.u = saddr->u; + } else if (strstart(uri, "file:", NULL)) { + addr->transport = MIGRATION_ADDRESS_TYPE_FILE; + addr->u.file.path = g_strdup(uri + strlen("file:")); + if (file_parse_offset(addr->u.file.path, &addr->u.file.offset, errp)) { + return false; + } } else { error_setg(errp, "unknown migration protocol: %s", uri); return false;
Signed-off-by: Fabiano Rosas <farosas@suse.de> --- migration/file.c | 2 +- migration/file.h | 1 + migration/migration.c | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-)