mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
migration: Create socket-address parameter
It will be used to store the uri parameters. We want this only for tcp, so we don't set it for other uris. We need it to know what port is migration running. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> dgilbert: Removed DummyStruct as suggested by Eric & Markus --
This commit is contained in:
parent
cdf842299d
commit
9aca82ba31
5 changed files with 77 additions and 1 deletions
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/cutils.h"
|
||||
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
@ -177,6 +178,7 @@ static void socket_start_incoming_migration(SocketAddress *saddr,
|
|||
Error **errp)
|
||||
{
|
||||
QIONetListener *listener = qio_net_listener_new();
|
||||
size_t i;
|
||||
|
||||
qio_net_listener_set_name(listener, "migration-socket-listener");
|
||||
|
||||
|
@ -189,6 +191,15 @@ static void socket_start_incoming_migration(SocketAddress *saddr,
|
|||
socket_accept_incoming_migration,
|
||||
NULL, NULL,
|
||||
g_main_context_get_thread_default());
|
||||
|
||||
for (i = 0; i < listener->nsioc; i++) {
|
||||
SocketAddress *address =
|
||||
qio_channel_socket_get_local_address(listener->sioc[i], errp);
|
||||
if (!address) {
|
||||
return;
|
||||
}
|
||||
migrate_add_address(address);
|
||||
}
|
||||
}
|
||||
|
||||
void tcp_start_incoming_migration(const char *host_port, Error **errp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue