@@ -39,6 +39,8 @@ over any transport.
- exec migration: do the migration using the stdin/stdout through a process.
- fd migration: do the migration using a file descriptor that is
passed to QEMU. QEMU doesn't care how this file descriptor is opened.
+- file migration: do the migration using a file that is passed by name
+ to QEMU.
In addition, support is included for migration using RDMA, which
transports the page data using ``RDMA``, where the hardware takes care of
@@ -19,3 +19,18 @@ void file_start_outgoing_migration(MigrationState *s, const char *fname, Error *
migration_channel_connect(s, QIO_CHANNEL(ioc), NULL, NULL);
object_unref(OBJECT(ioc));
}
+
+void file_start_incoming_migration(const char *fname, Error **errp)
+{
+ QIOChannelFile *ioc;
+
+ ioc = qio_channel_file_new_path(fname, O_RDONLY, 0, errp);
+ if (!ioc) {
+ error_report("Error creating a channel");
+ return;
+ }
+
+ qio_channel_set_name(QIO_CHANNEL(ioc), "migration-file-incoming");
+ migration_channel_process_incoming(QIO_CHANNEL(ioc));
+ object_unref(OBJECT(ioc));
+}
@@ -5,5 +5,6 @@ void file_start_outgoing_migration(MigrationState *s,
const char *filename,
Error **errp);
+void file_start_incoming_migration(const char *fname, Error **errp);
#endif
@@ -527,6 +527,8 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp)
exec_start_incoming_migration(p, errp);
} else if (strstart(uri, "fd:", &p)) {
fd_start_incoming_migration(p, errp);
+ } else if (strstart(uri, "file:", &p)) {
+ file_start_incoming_migration(p, errp);
} else {
error_setg(errp, "unknown migration protocol: %s", uri);
}