diff options
author | Juan Quintela <quintela@redhat.com> | 2018-02-19 18:59:02 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2018-05-15 20:24:27 +0200 |
commit | 62c1e0ca739008aaec6d3a18456f479bed61713b (patch) | |
tree | 0c146a0fa783a26db1586d74b46f87c3a7079007 /migration | |
parent | 667707078d8d365d449d1908805c09506f67825f (diff) | |
download | qemu-62c1e0ca739008aaec6d3a18456f479bed61713b.zip qemu-62c1e0ca739008aaec6d3a18456f479bed61713b.tar.gz qemu-62c1e0ca739008aaec6d3a18456f479bed61713b.tar.bz2 |
migration: Be sure all recv channels are created
We need them before we start migration.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/migration.c | 6 | ||||
-rw-r--r-- | migration/ram.c | 11 | ||||
-rw-r--r-- | migration/ram.h | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/migration/migration.c b/migration/migration.c index 4a7959c..8e5b421 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -462,7 +462,11 @@ void migration_ioc_process_incoming(QIOChannel *ioc) */ bool migration_has_all_channels(void) { - return true; + bool all_channels; + + all_channels = multifd_recv_all_channels_created(); + + return all_channels; } /* diff --git a/migration/ram.c b/migration/ram.c index 1aa661e..d5335c1 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -671,6 +671,17 @@ int multifd_load_setup(void) return 0; } +bool multifd_recv_all_channels_created(void) +{ + int thread_count = migrate_multifd_channels(); + + if (!migrate_use_multifd()) { + return true; + } + + return thread_count == atomic_read(&multifd_recv_state->count); +} + void multifd_recv_new_channel(QIOChannel *ioc) { /* nothing to do yet */ diff --git a/migration/ram.h b/migration/ram.h index 06dbddc..3f4b7da 100644 --- a/migration/ram.h +++ b/migration/ram.h @@ -45,6 +45,7 @@ int multifd_save_setup(void); int multifd_save_cleanup(Error **errp); int multifd_load_setup(void); int multifd_load_cleanup(Error **errp); +bool multifd_recv_all_channels_created(void); void multifd_recv_new_channel(QIOChannel *ioc); uint64_t ram_pagesize_summary(void); |