migration/multifd: Add a wrapper for channels_created

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>
This commit is contained in:
Fabiano Rosas 2024-02-29 12:30:10 -03:00 committed by Peter Xu
parent d117ed0699
commit a8a3e7102c
2 changed files with 7 additions and 1 deletions

View file

@ -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 */
/**
@ -1023,7 +1028,7 @@ out:
* 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;

View file

@ -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);