qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: prerna.saxena@nutanix.com, dgilbert@redhat.com,
	pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com,
	eblake@redhat.com, manish.mishra@nutanix.com,
	aravind.retnakaran@nutanix.com, Het Gala <het.gala@nutanix.com>,
	Juan Quintela <quintela@redhat.com>, Peter Xu <peterx@redhat.com>,
	Leonardo Bras <leobras@redhat.com>
Subject: [PATCH v15 04/14] fixup! migration: convert migration 'uri' into 'MigrateAddress'
Date: Mon, 23 Oct 2023 15:20:43 -0300	[thread overview]
Message-ID: <20231023182053.8711-5-farosas@suse.de> (raw)
In-Reply-To: <20231023182053.8711-1-farosas@suse.de>

Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
---
 migration/file.c      | 2 +-
 migration/file.h      | 1 +
 migration/migration.c | 7 +++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

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 639e89db43..ac91984d39 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -465,6 +465,13 @@ 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.filename = g_strdup(uri + strlen("file:"));
+        if (file_parse_offset(addr->u.file.filename, &addr->u.file.offset,
+                              errp)) {
+            return false;
+        }
     } else {
         error_setg(errp, "unknown migration protocol: %s", uri);
         return false;
-- 
2.35.3



  parent reply	other threads:[~2023-10-23 18:21 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 18:20 [PATCH v15 00/14] migration: Modify 'migrate' and 'migrate-incoming' QAPI commands for migration Fabiano Rosas
2023-10-23 18:20 ` [PATCH v15 01/14] migration: New QAPI type 'MigrateAddress' Fabiano Rosas
2023-10-23 18:20 ` [PATCH v15 02/14] fixup! " Fabiano Rosas
2023-10-24  5:50   ` Markus Armbruster
2023-10-31 14:48   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 03/14] migration: convert migration 'uri' into 'MigrateAddress' Fabiano Rosas
2023-10-31 15:02   ` Juan Quintela
2023-10-23 18:20 ` Fabiano Rosas [this message]
2023-10-31 15:02   ` [PATCH v15 04/14] fixup! " Juan Quintela
2023-10-23 18:20 ` [PATCH v15 05/14] migration: convert socket backend to accept MigrateAddress Fabiano Rosas
2023-10-31 15:12   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 06/14] migration: convert rdma " Fabiano Rosas
2023-10-31 15:31   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 07/14] migration: convert exec " Fabiano Rosas
2023-10-31 15:31   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 08/14] migration: Convert the file backend to the new QAPI syntax Fabiano Rosas
2023-10-31 17:00   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 09/14] migration: New migrate and migrate-incoming argument 'channels' Fabiano Rosas
2023-10-31 17:09   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 10/14] fixup! " Fabiano Rosas
2023-10-24  5:50   ` Markus Armbruster
2023-10-31 17:17   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 11/14] migration: modify migration_channels_and_uri_compatible() for new QAPI syntax Fabiano Rosas
2023-10-31 17:21   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 12/14] migration: Implement MigrateChannelList to qmp migration flow Fabiano Rosas
2023-10-31 17:53   ` Juan Quintela
2023-11-03 10:43   ` Juan Quintela
2023-10-23 18:20 ` [PATCH v15 13/14] migration: Implement MigrateChannelList to hmp " Fabiano Rosas
2023-10-31 17:42   ` Juan Quintela
2023-10-31 18:51     ` Het Gala
2023-10-31 18:55       ` Juan Quintela
2023-10-31 19:09         ` Het Gala
2023-10-31 22:38           ` Juan Quintela
2023-10-31 18:57     ` Peter Xu
2023-10-23 18:20 ` [PATCH v15 14/14] migration: modify test_multifd_tcp_none() to use new QAPI syntax Fabiano Rosas
2023-10-31 17:29   ` Juan Quintela

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=20231023182053.8711-5-farosas@suse.de \
    --to=farosas@suse.de \
    --cc=aravind.retnakaran@nutanix.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=het.gala@nutanix.com \
    --cc=leobras@redhat.com \
    --cc=manish.mishra@nutanix.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=prerna.saxena@nutanix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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).