[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/14] migration: Allow migrate_fd_connect to take an
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PULL 01/14] migration: Allow migrate_fd_connect to take an Error * |
Date: |
Tue, 6 Feb 2018 15:49:23 +0000 |
From: "Dr. David Alan Gilbert" <address@hidden>
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 <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
---
migration/channel.c | 2 +-
migration/migration.c | 7 ++++++-
migration/migration.h | 2 +-
migration/rdma.c | 2 +-
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/migration/channel.c b/migration/channel.c
index 70ec7ea3b7..fdb7ddbd17 100644
--- a/migration/channel.c
+++ b/migration/channel.c
@@ -78,6 +78,6 @@ void migration_channel_connect(MigrationState *s,
s->to_dst_file = f;
- migrate_fd_connect(s);
+ migrate_fd_connect(s, NULL);
}
}
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,
diff --git a/migration/migration.h b/migration/migration.h
index 786d971ce2..d3b214e5ba 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -190,7 +190,7 @@ uint64_t migrate_max_downtime(void);
void migrate_set_error(MigrationState *s, const Error *error);
void migrate_fd_error(MigrationState *s, const Error *error);
-void migrate_fd_connect(MigrationState *s);
+void migrate_fd_connect(MigrationState *s, Error *error_in);
MigrationState *migrate_init(void);
bool migration_is_blocked(Error **errp);
diff --git a/migration/rdma.c b/migration/rdma.c
index 9d5a424011..da474fc19f 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -3758,7 +3758,7 @@ void rdma_start_outgoing_migration(void *opaque,
trace_rdma_start_outgoing_migration_after_rdma_connect();
s->to_dst_file = qemu_fopen_rdma(rdma, "wb");
- migrate_fd_connect(s);
+ migrate_fd_connect(s, NULL);
return;
err:
g_free(rdma);
--
2.14.3
- [Qemu-devel] [PULL 00/14] migration queue, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 01/14] migration: Allow migrate_fd_connect to take an Error *,
Dr. David Alan Gilbert (git) <=
- [Qemu-devel] [PULL 02/14] migration: Route errors down through migration_channel_connect, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 03/14] migration/savevm.c: set MAX_VM_CMD_PACKAGED_SIZE to 1ul << 32, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 04/14] migration: use s->threshold_size inside migration_update_counters, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 05/14] migration: Drop current address parameter from save_zero_page(), Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 06/14] tests: Remove deprecated migration tests commands, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 07/14] tests: Consolidate accelerators declaration, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 08/14] tests: Use consistent names for migration, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 09/14] tests: Add deprecated commands migration test, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 10/14] tests: Create migrate-start-postcopy command, Dr. David Alan Gilbert (git), 2018/02/06
- [Qemu-devel] [PULL 11/14] tests: Adjust sleeps for migration test, Dr. David Alan Gilbert (git), 2018/02/06