[Spice-devel] [PATCH] server: multiple clients works ok if we limit the pipe to the slowest client

2015-12-04 Thread Frediano Ziglio
From: Alon Levy 

Signed-off-by: Alon Levy 
Signed-off-by: Frediano Ziglio 
---
 server/red-worker.c | 7 +++
 server/reds.c   | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/server/red-worker.c b/server/red-worker.c
index 1b2bb77..baa8458 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -177,7 +177,7 @@ static int red_process_cursor(RedWorker *worker, uint32_t 
max_pipe_size, int *ri
 
 *ring_is_empty = FALSE;
 while (!cursor_is_connected(worker) ||
-   red_channel_min_pipe_size(RED_CHANNEL(worker->cursor_channel)) <= 
max_pipe_size) {
+   red_channel_max_pipe_size(RED_CHANNEL(worker->cursor_channel)) <= 
max_pipe_size) {
 if (!worker->qxl->st->qif->get_cursor_command(worker->qxl, _cmd)) {
 *ring_is_empty = TRUE;
 if (worker->cursor_poll_tries < CMD_RING_POLL_RETRIES) {
@@ -238,8 +238,7 @@ static int red_process_display(RedWorker *worker, uint32_t 
max_pipe_size, int *r
 worker->process_display_generation++;
 *ring_is_empty = FALSE;
 while (!display_is_connected(worker) ||
-   // TODO: change to average pipe size?
-   red_channel_min_pipe_size(RED_CHANNEL(worker->display_channel)) <= 
max_pipe_size) {
+   red_channel_max_pipe_size(RED_CHANNEL(worker->display_channel)) <= 
max_pipe_size) {
 if (!worker->qxl->st->qif->get_command(worker->qxl, _cmd)) {
 *ring_is_empty = TRUE;;
 if (worker->display_poll_tries < CMD_RING_POLL_RETRIES) {
@@ -447,7 +446,7 @@ static void flush_cursor_commands(RedWorker *worker)
 for (;;) {
 red_channel_push(RED_CHANNEL(worker->cursor_channel));
 if (!cursor_is_connected(worker)
-|| red_channel_min_pipe_size(cursor_red_channel) <= 
MAX_PIPE_SIZE) {
+|| red_channel_max_pipe_size(cursor_red_channel) <= 
MAX_PIPE_SIZE) {
 break;
 }
 RedChannel *channel = (RedChannel *)worker->cursor_channel;
diff --git a/server/reds.c b/server/reds.c
index f3d1b24..d890616 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3347,7 +3347,7 @@ static int do_spice_init(SpiceCoreInterface 
*core_interface)
 
 reds->allow_multiple_clients = getenv(SPICE_DEBUG_ALLOW_MC_ENV) != NULL;
 if (reds->allow_multiple_clients) {
-spice_warning("spice: allowing multiple client connections (crashy)");
+spice_warning("spice: allowing multiple client connections");
 }
 atexit(reds_exit);
 return 0;
-- 
2.4.3

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [PATCH] server: multiple clients works ok if we limit the pipe to the slowest client

2015-12-04 Thread Fabiano FidĂȘncio
On Fri, Dec 4, 2015 at 4:27 PM, Frediano Ziglio  wrote:
> From: Alon Levy 
>
> Signed-off-by: Alon Levy 
> Signed-off-by: Frediano Ziglio 
> ---
>  server/red-worker.c | 7 +++
>  server/reds.c   | 2 +-
>  2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/server/red-worker.c b/server/red-worker.c
> index 1b2bb77..baa8458 100644
> --- a/server/red-worker.c
> +++ b/server/red-worker.c
> @@ -177,7 +177,7 @@ static int red_process_cursor(RedWorker *worker, uint32_t 
> max_pipe_size, int *ri
>
>  *ring_is_empty = FALSE;
>  while (!cursor_is_connected(worker) ||
> -   red_channel_min_pipe_size(RED_CHANNEL(worker->cursor_channel)) <= 
> max_pipe_size) {
> +   red_channel_max_pipe_size(RED_CHANNEL(worker->cursor_channel)) <= 
> max_pipe_size) {
>  if (!worker->qxl->st->qif->get_cursor_command(worker->qxl, 
> _cmd)) {
>  *ring_is_empty = TRUE;
>  if (worker->cursor_poll_tries < CMD_RING_POLL_RETRIES) {
> @@ -238,8 +238,7 @@ static int red_process_display(RedWorker *worker, 
> uint32_t max_pipe_size, int *r
>  worker->process_display_generation++;
>  *ring_is_empty = FALSE;
>  while (!display_is_connected(worker) ||
> -   // TODO: change to average pipe size?
> -   red_channel_min_pipe_size(RED_CHANNEL(worker->display_channel)) 
> <= max_pipe_size) {
> +   red_channel_max_pipe_size(RED_CHANNEL(worker->display_channel)) 
> <= max_pipe_size) {
>  if (!worker->qxl->st->qif->get_command(worker->qxl, _cmd)) {
>  *ring_is_empty = TRUE;;
>  if (worker->display_poll_tries < CMD_RING_POLL_RETRIES) {
> @@ -447,7 +446,7 @@ static void flush_cursor_commands(RedWorker *worker)
>  for (;;) {
>  red_channel_push(RED_CHANNEL(worker->cursor_channel));
>  if (!cursor_is_connected(worker)
> -|| red_channel_min_pipe_size(cursor_red_channel) <= 
> MAX_PIPE_SIZE) {
> +|| red_channel_max_pipe_size(cursor_red_channel) <= 
> MAX_PIPE_SIZE) {
>  break;
>  }
>  RedChannel *channel = (RedChannel *)worker->cursor_channel;
> diff --git a/server/reds.c b/server/reds.c
> index f3d1b24..d890616 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3347,7 +3347,7 @@ static int do_spice_init(SpiceCoreInterface 
> *core_interface)
>
>  reds->allow_multiple_clients = getenv(SPICE_DEBUG_ALLOW_MC_ENV) != NULL;
>  if (reds->allow_multiple_clients) {
> -spice_warning("spice: allowing multiple client connections 
> (crashy)");
> +spice_warning("spice: allowing multiple client connections");
>  }
>  atexit(reds_exit);
>  return 0;
> --
> 2.4.3
>
> ___
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel

Yeah. Jezz, I've acked the wrong patch. This is the one I've tested.
Go for it, please.
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Spice-devel] [PATCH] server: multiple clients works ok if we limit the pipe to the slowest client

2014-10-24 Thread Fabiano FidĂȘncio
From: Alon Levy a...@pobox.com

---
 server/red_worker.c | 5 +++--
 server/reds.c   | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index e177b68..8fed870 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -4961,7 +4961,7 @@ static int red_process_cursor(RedWorker *worker, uint32_t 
max_pipe_size, int *ri
 
 *ring_is_empty = FALSE;
 while (!cursor_is_connected(worker) ||
-   red_channel_min_pipe_size(worker-cursor_channel-common.base) = 
max_pipe_size) {
+   red_channel_max_pipe_size(worker-cursor_channel-common.base) = 
max_pipe_size) {
 if (!worker-qxl-st-qif-get_cursor_command(worker-qxl, ext_cmd)) {
 *ring_is_empty = TRUE;
 if (worker-repoll_cursor_ring  CMD_RING_POLL_RETRIES) {
@@ -5020,7 +5020,8 @@ static int red_process_commands(RedWorker *worker, 
uint32_t max_pipe_size, int *
 worker-process_commands_generation++;
 *ring_is_empty = FALSE;
 while (!display_is_connected(worker) ||
-   // TODO: change to average pipe size?
+   /* this is safe but slow, in the future client groups will rule the 
world, and
+* dial up will live with T1 pipes in harmony */
red_channel_min_pipe_size(worker-display_channel-common.base) = 
max_pipe_size) {
 if (!worker-qxl-st-qif-get_command(worker-qxl, ext_cmd)) {
 *ring_is_empty = TRUE;;
diff --git a/server/reds.c b/server/reds.c
index 6864d36..0d2ad88 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -3256,7 +3256,7 @@ static int do_spice_init(SpiceCoreInterface 
*core_interface)
 
 reds-allow_multiple_clients = getenv(SPICE_DEBUG_ALLOW_MC_ENV) != NULL;
 if (reds-allow_multiple_clients) {
-spice_warning(spice: allowing multiple client connections (crashy));
+spice_warning(spice: allowing multiple client connections);
 }
 atexit(reds_exit);
 return 0;
-- 
2.1.0

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel