[Spice-commits] 3 commits - server/reds.c server/reds-private.h
Frediano Ziglio
fziglio at kemper.freedesktop.org
Fri Jan 29 02:40:17 PST 2016
server/reds-private.h | 3 +++
server/reds.c | 20 ++++++++++----------
2 files changed, 13 insertions(+), 10 deletions(-)
New commits:
commit d4d674793779bb16ed3f1d5f78717eb48b9485b9
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Tue Jan 27 13:26:02 2015 -0600
Move spice_secure_port to RedsState struct
removing more global variables
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/reds-private.h b/server/reds-private.h
index 7dfec7f..427ce8e 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -194,6 +194,7 @@ struct RedsState {
const char *default_renderer;
int spice_port;
+ int spice_secure_port;
};
#endif
diff --git a/server/reds.c b/server/reds.c
index feef532..9e56780 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -149,7 +149,6 @@ static SpiceMigrateInstance *migration_interface = NULL;
static TicketAuthentication taTicket;
-static int spice_secure_port = -1;
static int spice_listen_socket_fd = -1;
static char spice_addr[256];
static int spice_family = PF_UNSPEC;
@@ -2584,8 +2583,8 @@ static int reds_init_net(RedsState *reds)
}
}
- if (spice_secure_port != -1) {
- reds->secure_listen_socket = reds_init_socket(spice_addr, spice_secure_port,
+ if (reds->spice_secure_port != -1) {
+ reds->secure_listen_socket = reds_init_socket(spice_addr, reds->spice_secure_port,
spice_family);
if (-1 == reds->secure_listen_socket) {
return -1;
@@ -3440,6 +3439,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
reds = spice_new0(RedsState, 1);
reds->default_renderer = "sw";
reds->spice_port = -1;
+ reds->spice_secure_port = -1;
return reds;
}
@@ -3651,7 +3651,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_tls(SpiceServer *s, int port,
}
memset(&ssl_parameters, 0, sizeof(ssl_parameters));
- spice_secure_port = port;
+ s->spice_secure_port = port;
g_strlcpy(ssl_parameters.ca_certificate_file, ca_cert_file,
sizeof(ssl_parameters.ca_certificate_file));
g_strlcpy(ssl_parameters.certs_file, certs_file,
commit 40f1e9429b5d425ec534677522829578f157fc24
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Tue Jan 27 11:19:21 2015 -0600
Move spice_port to RedsState struct
Remove another global variable
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/reds-private.h b/server/reds-private.h
index 48de998..7dfec7f 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -192,6 +192,8 @@ struct RedsState {
uint32_t mm_time_latency;
const char *default_renderer;
+
+ int spice_port;
};
#endif
diff --git a/server/reds.c b/server/reds.c
index 2aa0a0f..feef532 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -149,7 +149,6 @@ static SpiceMigrateInstance *migration_interface = NULL;
static TicketAuthentication taTicket;
-static int spice_port = -1;
static int spice_secure_port = -1;
static int spice_listen_socket_fd = -1;
static char spice_addr[256];
@@ -2571,8 +2570,8 @@ void reds_set_client_mm_time_latency(RedsState *reds, RedClient *client, uint32_
static int reds_init_net(RedsState *reds)
{
- if (spice_port != -1 || spice_family == AF_UNIX) {
- reds->listen_socket = reds_init_socket(spice_addr, spice_port, spice_family);
+ if (reds->spice_port != -1 || spice_family == AF_UNIX) {
+ reds->listen_socket = reds_init_socket(spice_addr, reds->spice_port, spice_family);
if (-1 == reds->listen_socket) {
return -1;
}
@@ -3440,6 +3439,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
reds = spice_new0(RedsState, 1);
reds->default_renderer = "sw";
+ reds->spice_port = -1;
return reds;
}
@@ -3523,7 +3523,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_port(SpiceServer *s, int port)
if (port < 0 || port > 0xffff) {
return -1;
}
- spice_port = port;
+ s->spice_port = port;
return 0;
}
commit 8c8888e009967728bd80b68a358541764e761487
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Thu Jan 22 09:58:49 2015 -0600
Change init_vd_agent_resources() to take RedsState arg
Acked-by: Pavel Grunt <pgrunt at redhat.com>
diff --git a/server/reds.c b/server/reds.c
index 35442b0..2aa0a0f 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3319,7 +3319,7 @@ SPICE_GNUC_VISIBLE int spice_server_remove_interface(SpiceBaseInstance *sin)
return 0;
}
-static void init_vd_agent_resources(void)
+static void reds_init_vd_agent_resources(RedsState *reds)
{
VDIPortState *state = &reds->agent_state;
int i;
@@ -3355,7 +3355,7 @@ static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface)
core = &core_interface_adapter;
reds->listen_socket = -1;
reds->secure_listen_socket = -1;
- init_vd_agent_resources();
+ reds_init_vd_agent_resources(reds);
ring_init(&reds->clients);
reds->num_clients = 0;
main_dispatcher_init(core);
More information about the Spice-commits
mailing list