summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-04-24 10:31:41 +0300
committerAlon Levy <alevy@redhat.com>2011-08-23 18:03:02 +0300
commit5117efcff7b61cd9ac9db88ab36a325b26f773ec (patch)
tree1bc0d5dc95f1df108d7441ec7b016a8c7a22c2c0 /server
parent4db9f1d1a9df95e84312f142cf5a0fa233376e21 (diff)
downloadspice-5117efcff7b61cd9ac9db88ab36a325b26f773ec.tar.gz
spice-5117efcff7b61cd9ac9db88ab36a325b26f773ec.tar.xz
spice-5117efcff7b61cd9ac9db88ab36a325b26f773ec.zip
server/reds: add RedsState.allow_multiple_clients
Currently set by environment variable SPICE_DEBUG_ALLOW_MC (any value means to allow multiple connections). Later will be set by spice api from qemu.
Diffstat (limited to 'server')
-rw-r--r--server/reds.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/reds.c b/server/reds.c
index e078594f..b8b4d26f 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -74,6 +74,10 @@
SpiceCoreInterface *core = NULL;
static SpiceCharDeviceInstance *vdagent = NULL;
+/* Debugging only variable: allow multiple client connections to the spice
+ * server */
+#define SPICE_DEBUG_ALLOW_MC_ENV "SPICE_DEBUG_ALLOW_MC"
+
#define MIGRATION_NOTIFY_SPICE_KEY "spice_mig_ext"
#define REDS_MIG_VERSION 3
@@ -228,6 +232,7 @@ typedef struct RedsState {
RedsStatValue roundtrip_stat;
#endif
int peer_minor_version;
+ int allow_multiple_clients;
} RedsState;
static RedsState *reds = NULL;
@@ -1502,7 +1507,9 @@ static void reds_handle_main_link(RedLinkInfo *link)
red_printf("");
link_mess = link->link_mess;
- reds_disconnect();
+ if (!reds->allow_multiple_clients) {
+ reds_disconnect();
+ }
if (link_mess->connection_id == 0) {
reds_send_link_result(link, SPICE_LINK_ERR_OK);
@@ -3533,6 +3540,10 @@ static int do_spice_init(SpiceCoreInterface *core_interface)
inputs_init();
reds->mouse_mode = SPICE_MOUSE_MODE_SERVER;
+ reds->allow_multiple_clients = getenv(SPICE_DEBUG_ALLOW_MC_ENV) != NULL;
+ if (reds->allow_multiple_clients) {
+ red_printf("spice: allowing multiple client connections");
+ }
atexit(reds_exit);
return 0;