Skip to content

Commit

Permalink
migration/multifd: Add a wrapper for channels_created
Browse files Browse the repository at this point in the history
We'll need to access multifd_send_state->channels_created from outside
multifd.c, so introduce a helper for that.

Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/r/20240229153017.2221-17-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
  • Loading branch information
Fabiano Rosas authored and xzpeter committed Mar 1, 2024
1 parent d117ed0 commit a8a3e71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion migration/multifd.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ static bool multifd_use_packets(void)
return !migrate_mapped_ram();
}

void multifd_send_channel_created(void)
{
qemu_sem_post(&multifd_send_state->channels_created);
}

/* Multifd without compression */

/**
Expand Down Expand Up @@ -1023,7 +1028,7 @@ static void multifd_new_send_channel_async(QIOTask *task, gpointer opaque)
* Here we're not interested whether creation succeeded, only that
* it happened at all.
*/
qemu_sem_post(&multifd_send_state->channels_created);
multifd_send_channel_created();

if (ret) {
return;
Expand Down
1 change: 1 addition & 0 deletions migration/multifd.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ typedef struct MultiFDRecvData MultiFDRecvData;

bool multifd_send_setup(void);
void multifd_send_shutdown(void);
void multifd_send_channel_created(void);
int multifd_recv_setup(Error **errp);
void multifd_recv_cleanup(void);
void multifd_recv_shutdown(void);
Expand Down

0 comments on commit a8a3e71

Please sign in to comment.