mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
Implement spice_server_set_exit_on_disconnect to enable an option whereby the spice server shuts down on client disconnect.
This commit is contained in:
parent
bf29ff4296
commit
5819976c7e
@ -12,10 +12,10 @@ AC_PREREQ([2.57])
|
||||
|
||||
m4_define([SPICE_MAJOR], 0)
|
||||
m4_define([SPICE_MINOR], 11)
|
||||
m4_define([SPICE_MICRO], 3)
|
||||
m4_define([SPICE_CURRENT], [4])
|
||||
m4_define([SPICE_MICRO], 4)
|
||||
m4_define([SPICE_CURRENT], [5])
|
||||
m4_define([SPICE_REVISION], [0])
|
||||
m4_define([SPICE_AGE], [3])
|
||||
m4_define([SPICE_AGE], [4])
|
||||
|
||||
# Note on the library name on linux (SONAME) produced by libtool (for reference, gleaned
|
||||
# from looking at libtool 2.4.2)
|
||||
|
||||
@ -119,6 +119,7 @@ void *red_tunnel = NULL;
|
||||
#endif
|
||||
int agent_mouse = TRUE;
|
||||
int agent_copypaste = TRUE;
|
||||
static bool exit_on_disconnect = FALSE;
|
||||
|
||||
#define MIGRATE_TIMEOUT (1000 * 10) /* 10sec */
|
||||
#define MM_TIMER_GRANULARITY_MS (1000 / 30)
|
||||
@ -673,6 +674,12 @@ void reds_client_disconnect(RedClient *client)
|
||||
{
|
||||
RedsMigTargetClient *mig_client;
|
||||
|
||||
if (exit_on_disconnect)
|
||||
{
|
||||
spice_info("Exiting server because of client disconnect.\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!client || client->disconnecting) {
|
||||
return;
|
||||
}
|
||||
@ -4061,6 +4068,13 @@ SPICE_GNUC_VISIBLE int spice_server_set_listen_socket_fd(SpiceServer *s, int lis
|
||||
return 0;
|
||||
}
|
||||
|
||||
SPICE_GNUC_VISIBLE int spice_server_set_exit_on_disconnect(SpiceServer *s, int flag)
|
||||
{
|
||||
spice_assert(reds == s);
|
||||
exit_on_disconnect = !!flag;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SPICE_GNUC_VISIBLE int spice_server_set_noauth(SpiceServer *s)
|
||||
{
|
||||
spice_assert(reds == s);
|
||||
|
||||
@ -123,3 +123,7 @@ global:
|
||||
spice_server_vm_stop;
|
||||
spice_server_set_seamless_migration;
|
||||
} SPICE_SERVER_0.10.4;
|
||||
|
||||
SPICE_SERVER_0.11.4 {
|
||||
spice_server_set_exit_on_disconnect;
|
||||
} SPICE_SERVER_0.11.2;
|
||||
|
||||
@ -427,6 +427,7 @@ int spice_server_set_compat_version(SpiceServer *s,
|
||||
int spice_server_set_port(SpiceServer *s, int port);
|
||||
void spice_server_set_addr(SpiceServer *s, const char *addr, int flags);
|
||||
int spice_server_set_listen_socket_fd(SpiceServer *s, int listen_fd);
|
||||
int spice_server_set_exit_on_disconnect(SpiceServer *s, int flag);
|
||||
int spice_server_set_noauth(SpiceServer *s);
|
||||
int spice_server_set_sasl(SpiceServer *s, int enabled);
|
||||
int spice_server_set_sasl_appname(SpiceServer *s, const char *appname);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user