[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v10 14/24] migration: Be sure all recv channels are
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH v10 14/24] migration: Be sure all recv channels are created |
Date: |
Wed, 7 Mar 2018 12:00:00 +0100 |
We need them before we start migration.
Signed-off-by: Juan Quintela <address@hidden>
---
migration/migration.c | 6 +++++-
migration/ram.c | 11 +++++++++++
migration/ram.h | 1 +
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/migration/migration.c b/migration/migration.c
index 919343232e..c06c34ca0f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -461,7 +461,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 f48c74585f..e502be5dda 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -625,6 +625,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 a2031acf59..3daf074bcc 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);
--
2.14.3
- Re: [Qemu-devel] [PATCH v10 04/24] migration: Set the migration tcp port, (continued)
- [Qemu-devel] [PATCH v10 12/24] migration: Reference counting recv channels correctly, Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 03/24] migration: Create tcp_port parameter, Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 07/24] [RFH] tests: Add migration compress threads tests, Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 06/24] tests: Add basic migration precopy tcp test, Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 11/24] migration: terminate_* can be called for other threads, Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 14/24] migration: Be sure all recv channels are created,
Juan Quintela <=
- [Qemu-devel] [PATCH v10 01/24] tests: Add migration precopy test, Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 10/24] migration: In case of error just end the migration, Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 02/24] tests: Add migration xbzrle test, Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 13/24] migration: Introduce multifd_recv_new_channel(), Juan Quintela, 2018/03/07
- [Qemu-devel] [PATCH v10 18/24] migration: Add multifd traces for start/end thread, Juan Quintela, 2018/03/07