[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH RFC 05/26] migration: Add a DestroyNotify parameter to socket_sen
From: |
Maciej S. Szmigiero |
Subject: |
[PATCH RFC 05/26] migration: Add a DestroyNotify parameter to socket_send_channel_create() |
Date: |
Tue, 16 Apr 2024 16:42:44 +0200 |
From: "Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>
Makes managing the memory easier.
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
---
migration/multifd.c | 2 +-
migration/postcopy-ram.c | 2 +-
migration/socket.c | 6 ++++--
migration/socket.h | 3 ++-
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/migration/multifd.c b/migration/multifd.c
index 039c0de40af5..4bc912d7500e 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -1138,7 +1138,7 @@ static bool
multifd_new_send_channel_create(MultiFDSendParams *p, Error **errp)
return file_send_channel_create(p, errp);
}
- socket_send_channel_create(multifd_new_send_channel_async, p);
+ socket_send_channel_create(multifd_new_send_channel_async, p, NULL);
return true;
}
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index eccff499cb20..e314e1023dc1 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -1715,7 +1715,7 @@ int postcopy_preempt_establish_channel(MigrationState *s)
void postcopy_preempt_setup(MigrationState *s)
{
/* Kick an async task to connect */
- socket_send_channel_create(postcopy_preempt_send_channel_new, s);
+ socket_send_channel_create(postcopy_preempt_send_channel_new, s, NULL);
}
static void postcopy_pause_ram_fast_load(MigrationIncomingState *mis)
diff --git a/migration/socket.c b/migration/socket.c
index 9ab89b1e089b..6639581cf18d 100644
--- a/migration/socket.c
+++ b/migration/socket.c
@@ -35,11 +35,13 @@ struct SocketOutgoingArgs {
SocketAddress *saddr;
} outgoing_args;
-void socket_send_channel_create(QIOTaskFunc f, void *data)
+void socket_send_channel_create(QIOTaskFunc f,
+ void *data, GDestroyNotify data_destroy)
{
QIOChannelSocket *sioc = qio_channel_socket_new();
+
qio_channel_socket_connect_async(sioc, outgoing_args.saddr,
- f, data, NULL, NULL);
+ f, data, data_destroy, NULL);
}
QIOChannel *socket_send_channel_create_sync(Error **errp)
diff --git a/migration/socket.h b/migration/socket.h
index 46c233ecd29e..114ab34176aa 100644
--- a/migration/socket.h
+++ b/migration/socket.h
@@ -21,7 +21,8 @@
#include "io/task.h"
#include "qemu/sockets.h"
-void socket_send_channel_create(QIOTaskFunc f, void *data);
+void socket_send_channel_create(QIOTaskFunc f,
+ void *data, GDestroyNotify data_destroy);
QIOChannel *socket_send_channel_create_sync(Error **errp);
void socket_start_incoming_migration(SocketAddress *saddr, Error **errp);
- [PATCH RFC 00/26] Multifd 🔀 device state transfer support with VFIO consumer, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 03/26] migration: Add send/receive header for main channel, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 01/26] migration: Add x-channel-header pseudo-capability, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 02/26] migration: Add migration channel header send/receive, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 05/26] migration: Add a DestroyNotify parameter to socket_send_channel_create(),
Maciej S. Szmigiero <=
- [PATCH RFC 04/26] multifd: change multifd_new_send_channel_create() param type, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 06/26] multifd: pass MFDSendChannelConnectData when connecting sending socket, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 07/26] migration/postcopy: pass PostcopyPChannelConnectData when connecting sending preempt socket, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 09/26] migration: Add send/receive header for postcopy preempt channel, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 08/26] migration: Allow passing migration header in migration channel creation, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 10/26] migration: Add send/receive header for multifd channel, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 11/26] migration/options: Mapped-ram is not channel header compatible, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 12/26] migration: Enable x-channel-header pseudo-capability, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 13/26] vfio/migration: Add save_{iterate, complete_precopy}_started trace events, Maciej S. Szmigiero, 2024/04/16
- [PATCH RFC 14/26] migration/ram: Add load start trace event, Maciej S. Szmigiero, 2024/04/16