mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-27 15:45:54 +00:00
Move spice_listen_socket_fd to RedsState struct
Removing more global variables Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
d4d6747937
commit
6806bb6d46
@ -195,6 +195,7 @@ struct RedsState {
|
||||
|
||||
int spice_port;
|
||||
int spice_secure_port;
|
||||
int spice_listen_socket_fd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -149,7 +149,6 @@ static SpiceMigrateInstance *migration_interface = NULL;
|
||||
|
||||
static TicketAuthentication taTicket;
|
||||
|
||||
static int spice_listen_socket_fd = -1;
|
||||
static char spice_addr[256];
|
||||
static int spice_family = PF_UNSPEC;
|
||||
static int sasl_enabled = 0; // sasl disabled by default
|
||||
@ -2598,8 +2597,8 @@ static int reds_init_net(RedsState *reds)
|
||||
}
|
||||
}
|
||||
|
||||
if (spice_listen_socket_fd != -1 ) {
|
||||
reds->listen_socket = spice_listen_socket_fd;
|
||||
if (reds->spice_listen_socket_fd != -1 ) {
|
||||
reds->listen_socket = reds->spice_listen_socket_fd;
|
||||
reds->listen_watch = core->watch_add(core, reds->listen_socket,
|
||||
SPICE_WATCH_EVENT_READ,
|
||||
reds_accept, NULL);
|
||||
@ -3440,6 +3439,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
|
||||
reds->default_renderer = "sw";
|
||||
reds->spice_port = -1;
|
||||
reds->spice_secure_port = -1;
|
||||
reds->spice_listen_socket_fd = -1;
|
||||
return reds;
|
||||
}
|
||||
|
||||
@ -3547,7 +3547,7 @@ SPICE_GNUC_VISIBLE void spice_server_set_addr(SpiceServer *s, const char *addr,
|
||||
SPICE_GNUC_VISIBLE int spice_server_set_listen_socket_fd(SpiceServer *s, int listen_fd)
|
||||
{
|
||||
spice_assert(reds == s);
|
||||
spice_listen_socket_fd = listen_fd;
|
||||
s->spice_listen_socket_fd = listen_fd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user