[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v1 15/26] migration/multifd: Remove direct "socket" reference
From: |
Fabiano Rosas |
Subject: |
[RFC PATCH v1 15/26] migration/multifd: Remove direct "socket" references |
Date: |
Thu, 30 Mar 2023 15:03:25 -0300 |
We're about to enable support for other transports in multifd, so
remove direct references to sockets.
Signed-off-by: Fabiano Rosas <farosas@suse.de>
---
migration/multifd.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index cbc0dfe39b..e613d85e24 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -512,6 +512,11 @@ static void multifd_send_terminate_threads(Error *err)
}
}
+static int multifd_send_channel_destroy(QIOChannel *send)
+{
+ return socket_send_channel_destroy(send);
+}
+
void multifd_save_cleanup(void)
{
int i;
@@ -534,7 +539,7 @@ void multifd_save_cleanup(void)
if (p->registered_yank) {
migration_ioc_unregister_yank(p->c);
}
- socket_send_channel_destroy(p->c);
+ multifd_send_channel_destroy(p->c);
p->c = NULL;
qemu_mutex_destroy(&p->mutex);
qemu_sem_destroy(&p->sem);
@@ -889,20 +894,25 @@ static void
multifd_new_send_channel_cleanup(MultiFDSendParams *p,
static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque)
{
MultiFDSendParams *p = opaque;
- QIOChannel *sioc = QIO_CHANNEL(qio_task_get_source(task));
+ QIOChannel *ioc = QIO_CHANNEL(qio_task_get_source(task));
Error *local_err = NULL;
trace_multifd_new_send_channel_async(p->id);
if (!qio_task_propagate_error(task, &local_err)) {
- p->c = QIO_CHANNEL(sioc);
+ p->c = QIO_CHANNEL(ioc);
qio_channel_set_delay(p->c, false);
p->running = true;
- if (multifd_channel_connect(p, sioc, local_err)) {
+ if (multifd_channel_connect(p, ioc, local_err)) {
return;
}
}
- multifd_new_send_channel_cleanup(p, sioc, local_err);
+ multifd_new_send_channel_cleanup(p, ioc, local_err);
+}
+
+static void multifd_new_send_channel_create(gpointer opaque)
+{
+ socket_send_channel_create(multifd_new_send_channel_async, opaque);
}
int multifd_save_setup(Error **errp)
@@ -951,7 +961,7 @@ int multifd_save_setup(Error **errp)
p->write_flags = 0;
}
- socket_send_channel_create(multifd_new_send_channel_async, p);
+ multifd_new_send_channel_create(p);
}
for (i = 0; i < thread_count; i++) {
--
2.35.3
- [RFC PATCH v1 03/26] tests/qtest: migration: Add migrate_incoming_qmp helper, (continued)
- [RFC PATCH v1 03/26] tests/qtest: migration: Add migrate_incoming_qmp helper, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 05/26] migration: Initial support of fixed-ram feature for analyze-migration.py, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 06/26] io: add and implement QIO_CHANNEL_FEATURE_SEEKABLE for channel file, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 08/26] io: implement io_pwritev/preadv for QIOChannelFile, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 07/26] io: Add generic pwritev/preadv interface, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 09/26] migration/qemu-file: add utility methods for working with seekable channels, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 10/26] migration/ram: Introduce 'fixed-ram' migration stream capability, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 11/26] migration: Refactor precopy ram loading code, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 12/26] migration: Add support for 'fixed-ram' migration restore, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 13/26] tests/qtest: migration-test: Add tests for fixed-ram file-based migration, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 15/26] migration/multifd: Remove direct "socket" references,
Fabiano Rosas <=
- [RFC PATCH v1 14/26] migration: Add completion tracepoint, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 16/26] migration/multifd: Allow multifd without packets, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 17/26] migration/multifd: Add outgoing QIOChannelFile support, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 19/26] migration/multifd: Add pages to the receiving side, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 18/26] migration/multifd: Add incoming QIOChannelFile support, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 21/26] migration/ram: Add a wrapper for fixed-ram shadow bitmap, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 22/26] migration/multifd: Support outgoing fixed-ram stream format, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 20/26] io: Add a pwritev/preadv version that takes a discontiguous iovec, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 23/26] migration/multifd: Support incoming fixed-ram stream format, Fabiano Rosas, 2023/03/30
- [RFC PATCH v1 25/26] migration: Add direct-io parameter, Fabiano Rosas, 2023/03/30