diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2017-12-15 17:16:54 +0000 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2018-02-06 10:55:12 +0000 |
commit | cce8040bb0ea6ff56d8882aeb0a0435a61901d93 (patch) | |
tree | a64458e072675c88d43e17bde8472180c877930f /migration/migration.c | |
parent | 2b3805f370521deacab974b9c9ca07d2319a8890 (diff) |
migration: Allow migrate_fd_connect to take an Error *
Allow whatever is performing the connection to pass migrate_fd_connect
an error to indicate there was a problem during connection, an allow
us to clean up.
The caller must free the error.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'migration/migration.c')
-rw-r--r-- | migration/migration.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/migration/migration.c b/migration/migration.c index c99a4e62d7..1fbd304c66 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2378,10 +2378,15 @@ static void *migration_thread(void *opaque) return NULL; } -void migrate_fd_connect(MigrationState *s) +void migrate_fd_connect(MigrationState *s, Error *error_in) { s->expected_downtime = s->parameters.downtime_limit; s->cleanup_bh = qemu_bh_new(migrate_fd_cleanup, s); + if (error_in) { + migrate_fd_error(s, error_in); + migrate_fd_cleanup(s); + return; + } qemu_file_set_blocking(s->to_dst_file, true); qemu_file_set_rate_limit(s->to_dst_file, |