[Spice-devel] [PATCH v2 6/9] worker: remove useless check

2016-01-26 Thread Frediano Ziglio
display_channel is never NULL. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/red-worker.c b/server/red-worker.c index 9f967b4..dd20bd5 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -320,8 +320,7

[Spice-devel] [PATCH v2 0/9] Main loop changes

2016-01-26 Thread Frediano Ziglio
These are some small changes done after my analisys of loop problems. Beside the patch that rewrote SpiceTimer implementation worker ones are quite small and fix small bugs or change style. Changed from v1: - added some other patches. Frediano Ziglio (9): worker: remove max_pipe_size constant p

[Spice-devel] [PATCH v2 5/9] worker: remove useless test

2016-01-26 Thread Frediano Ziglio
red_channel_max_pipe_size returns 0 if no client (channel disconnected) no need to check if cursor_channel/display_channel are NULL or connected. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 18 -- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/server/

[Spice-devel] [PATCH v2 7/9] worker: unify flush_cursor_commands and flush_display_commands

2016-01-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-worker.c | 68 ++--- 1 file changed, 23 insertions(+), 45 deletions(-) diff --git a/server/red-worker.c b/server/red-worker.c index dd20bd5..5eb54f2 100644 --- a/server/red-worker.c +++ b/server/red-wor

[Spice-devel] [PATCH v2 8/9] worker: remove empty statement at line end

2016-01-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/red-worker.c b/server/red-worker.c index 5eb54f2..a5822a4 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -232,7 +232,7 @@ static int red_process_display

[Spice-devel] [PATCH v2 2/9] worker: do not leak cursor after disconnecting clients

2016-01-26 Thread Frediano Ziglio
This also prevents future use of a NULL pointer. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 1 - 1 file changed, 1 deletion(-) diff --git a/server/red-worker.c b/server/red-worker.c index 9a392ec..dd293f7 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -455,7 +455,6

[Spice-devel] [PATCH v2 1/9] worker: remove max_pipe_size constant parameter

2016-01-26 Thread Frediano Ziglio
All checks for full channel pipes have to be consistents so there is no point in passing as a parameter. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/server/red-worker.c b/server/red-worker.c i

[Spice-devel] [PATCH v2 3/9] worker: use variable already set at beginning of loops

2016-01-26 Thread Frediano Ziglio
This is mainly question of style. Instead of repeating same conversion use the variable we set at the beginning of the function. Note also that I used same name to make the two functions more similar. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 28 +--- 1 fil

[Spice-devel] [PATCH v2 9/9] replay: do not wake up loop too much

2016-01-26 Thread Frediano Ziglio
Send wakeups only when a command is available. This emulate better what a guest driver should do (append the command to the ring and then signal). Signed-off-by: Frediano Ziglio --- server/tests/replay.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/tests/replay

[Spice-devel] [PATCH v2 4/9] worker: improved implementation of SpiceTimer

2016-01-26 Thread Frediano Ziglio
Use a custom GSource. This to avoid having to allocate a timer all the time we add one. Signed-off-by: Frediano Ziglio --- server/event-loop.c | 56 +++-- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/server/event-loop.c b/server/

Re: [Spice-devel] [PATCH v2 1/9] worker: remove max_pipe_size constant parameter

2016-01-26 Thread Pavel Grunt
On Tue, 2016-01-26 at 09:44 +, Frediano Ziglio wrote: > All checks for full channel pipes have to be consistents > so there is no point in passing as a parameter. > > Signed-off-by: Frediano Ziglio Acked-by: Pavel Grunt > --- >  server/red-worker.c | 22 +++--- >  1 file chang

Re: [Spice-devel] [PATCH v2 3/9] worker: use variable already set at beginning of loops

2016-01-26 Thread Pavel Grunt
On Tue, 2016-01-26 at 09:44 +, Frediano Ziglio wrote: > This is mainly question of style. > Instead of repeating same conversion use the variable we set at the > beginning of the function. > Note also that I used same name to make the two functions more > similar. > > Signed-off-by: Frediano Z

Re: [Spice-devel] [PATCH v2 2/9] worker: do not leak cursor after disconnecting clients

2016-01-26 Thread Pavel Grunt
Hi, On Tue, 2016-01-26 at 09:44 +, Frediano Ziglio wrote: > This also prevents future use of a NULL pointer. > Can this happen now? Is it related to the PATCH 5/9 - function cursor_is_connected() ? Pavel > Signed-off-by: Frediano Ziglio > --- >  server/red-worker.c | 1 - >  1 file changed,

Re: [Spice-devel] [PATCH v2 8/9] worker: remove empty statement at line end

2016-01-26 Thread Pavel Grunt
On Tue, 2016-01-26 at 09:44 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio Acked-by: Pavel Grunt > --- >  server/red-worker.c | 2 +- >  1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/server/red-worker.c b/server/red-worker.c > index 5eb54f2..a5822a4 100644 > --- a

Re: [Spice-devel] [PATCH v2 2/9] worker: do not leak cursor after disconnecting clients

2016-01-26 Thread Frediano Ziglio
> > Hi, > > On Tue, 2016-01-26 at 09:44 +, Frediano Ziglio wrote: > > This also prevents future use of a NULL pointer. > > > Can this happen now? Is it related to the PATCH 5/9 - function > cursor_is_connected() ? > > Pavel > No, is not related. Calling cursor_channel_disconnect does not

Re: [Spice-devel] [PATCH v2 9/9] replay: do not wake up loop too much

2016-01-26 Thread Pavel Grunt
Hi, I would prefer to have a just one type of boolean and gboolean is already used in the code... Pavel On Tue, 2016-01-26 at 09:44 +, Frediano Ziglio wrote: > Send wakeups only when a command is available. > This emulate better what a guest driver should do (append the command > to the ring

[Spice-devel] [PATCH] worker: do not leak cursor after disconnecting clients

2016-01-26 Thread Frediano Ziglio
Calling cursor_channel_disconnect does not free cursor_display so this causes a leak. Is the only code where this pointer is reset preventing any further cursor channel connection. If a client is lazy reading cursor data during the flush connection is closed and further clients won't be able to use

[Spice-devel] [PATCH v2] replay: do not wake up loop too much

2016-01-26 Thread Frediano Ziglio
Send wakeups only when a command is available. This emulate better what a guest driver should do (append the command to the ring and then signal). Signed-off-by: Frediano Ziglio --- server/tests/replay.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) Changes from v2: - use only one t

Re: [Spice-devel] Patches I'd like to see merged earlier

2016-01-26 Thread Christophe Fergeau
On Mon, Jan 25, 2016 at 09:19:57AM -0500, Frediano Ziglio wrote: > Hi, > I found these patches on the refactory branch: > > http://cgit.freedesktop.org/~fziglio/spice-server/commit/?h=refactory&id=9e36956b302971aae119cb7d12cdc91345203dcd > http://cgit.freedesktop.org/~fziglio/spice-server/commit

[Spice-devel] need advice

2016-01-26 Thread Baurzhan Konurbayev
Hello, guys! I am trying to apply one of the patch series from https://patchwork.freedesktop.org/project/Spice/series/ However, I am getting some compilation issues. Could you, please, suggest if I took right sources? I cloned base sources from : - git://git.freedesktop.org/git/spice/spice-

Re: [Spice-devel] [spice-common v4 3/7] log: Use glib for logging

2016-01-26 Thread Frediano Ziglio
> > On Thu, Jan 21, 2016 at 07:29:59AM -0500, Frediano Ziglio wrote: > > > +/* Make sure GLib default log handler will show the debug > > > messages. Messing with > > > + * environment variables like this is ugly, but this only > > > happens when the legacy > > > +

Re: [Spice-devel] [spice-common v4 7/7] log: Introduce spice_assert_if_fail

2016-01-26 Thread Frediano Ziglio
> > They can be used in spice-server to replace spice_return_if_fail. > Currently spice_return_if_fail aborts in spice-server, and it's not > always clear whether using a non-aborting g_return_if_fail is acceptable > or not. Having a spice_assert_if_fail alternative makes it clearer that > this is

Re: [Spice-devel] need advice

2016-01-26 Thread Frediano Ziglio
> Hello, guys! > > I am trying to apply one of the patch series from > https://patchwork.freedesktop.org/project/Spice/series/ > > However, I am getting some compilation issues. > > Could you, please, suggest if I took right sources? > > I cloned base sources from : > - git://git.freedesktop

[Spice-devel] [PATCH] worker: use core interface to create watch

2016-01-26 Thread Frediano Ziglio
This increase code reuse and make Glib integration more straight forward. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/server/red-worker.c b/server/red-worker.c index a5822a4..05e21f0 100644 --- a/server/red

Re: [Spice-devel] need advice

2016-01-26 Thread Frediano Ziglio
> Thanks for the reply. > We would like to try hardware acceleration for our thin clients and > therefore, tried to apply the patch called "Add GStreamer support for video > streaming", https://patchwork.freedesktop.org/series/1874/ > Just in case, I attached the output from compilation process.

Re: [Spice-devel] need advice

2016-01-26 Thread Pavel Grunt
Hi, On Tue, 2016-01-26 at 18:11 +0600, Baurzhan Konurbayev wrote: > Thanks for the reply. > > We would like to try hardware acceleration for our thin clients and > therefore, tried to apply the patch called "Add GStreamer support for > video streaming", https://patchwork.freedesktop.org/series/18

Re: [Spice-devel] [PATCH] worker: use core interface to create watch

2016-01-26 Thread Christophe Fergeau
On Tue, Jan 26, 2016 at 12:11:55PM +, Frediano Ziglio wrote: > This increase code reuse and make Glib integration more straight forward. > > Signed-off-by: Frediano Ziglio > --- > server/red-worker.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/server/

Re: [Spice-devel] [PATCH v2] replay: do not wake up loop too much

2016-01-26 Thread Pavel Grunt
On Tue, 2016-01-26 at 10:57 +, Frediano Ziglio wrote: > Send wakeups only when a command is available. > This emulate better what a guest driver should do (append the command > to the ring and then signal). > > Signed-off-by: Frediano Ziglio Acked-by: Pavel Grunt > --- >  server/tests/replay

Re: [Spice-devel] [PATCH v2 4/9] worker: improved implementation of SpiceTimer

2016-01-26 Thread Christophe Fergeau
Looks good to me Acked-by: Christophe Fergeau Christophe On Tue, Jan 26, 2016 at 09:44:31AM +, Frediano Ziglio wrote: > Use a custom GSource. > This to avoid having to allocate a timer all the time we add one. > > Signed-off-by: Frediano Ziglio > --- > server/event-loop.c | 56 > +++

Re: [Spice-devel] [spice-common v4 3/7] log: Use glib for logging

2016-01-26 Thread Christophe Fergeau
On Tue, Jan 26, 2016 at 06:49:55AM -0500, Frediano Ziglio wrote: > > > > On Thu, Jan 21, 2016 at 07:29:59AM -0500, Frediano Ziglio wrote: > > > > +/* Make sure GLib default log handler will show the debug > > > > messages. Messing with > > > > + * environment variables like

Re: [Spice-devel] [spice-common v4 3/7] log: Use glib for logging

2016-01-26 Thread Frediano Ziglio
> > On Tue, Jan 26, 2016 at 06:49:55AM -0500, Frediano Ziglio wrote: > > > > > > On Thu, Jan 21, 2016 at 07:29:59AM -0500, Frediano Ziglio wrote: > > > > > +/* Make sure GLib default log handler will show the > > > > > debug > > > > > messages. Messing with > > > > > + * e

Re: [Spice-devel] [spice-common v4 7/7] log: Introduce spice_assert_if_fail

2016-01-26 Thread Christophe Fergeau
On Tue, Jan 26, 2016 at 06:53:20AM -0500, Frediano Ziglio wrote: > > > > They can be used in spice-server to replace spice_return_if_fail. > > Currently spice_return_if_fail aborts in spice-server, and it's not > > always clear whether using a non-aborting g_return_if_fail is acceptable > > or not

Re: [Spice-devel] [spice-common v4 7/7] log: Introduce spice_assert_if_fail

2016-01-26 Thread Frediano Ziglio
> > On Tue, Jan 26, 2016 at 06:53:20AM -0500, Frediano Ziglio wrote: > > > > > > They can be used in spice-server to replace spice_return_if_fail. > > > Currently spice_return_if_fail aborts in spice-server, and it's not > > > always clear whether using a non-aborting g_return_if_fail is acceptab

[Spice-devel] [PATCH final ?] worker: use glib main loop

2016-01-26 Thread Frediano Ziglio
Use the glib mainloop instead of writing our own. The glib loop is both cleaner to use and is more extensible. It is also very mature and reduces the maintenance burden on the spice server. Signed-off-by: Marc-André Lureau Signed-off-by: Jonathon Jongsma Signed-off-by: Frediano Ziglio --- serv

Re: [Spice-devel] [PATCH v2 7/9] worker: unify flush_cursor_commands and flush_display_commands

2016-01-26 Thread Pavel Grunt
On Tue, 2016-01-26 at 09:44 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- >  server/red-worker.c | 68 ++- > -- >  1 file changed, 23 insertions(+), 45 deletions(-) > > diff --git a/server/red-worker.c b/server/red-worker.c > i

Re: [Spice-devel] [PATCH] log: add not fatal spice_return function

2016-01-26 Thread Christophe Fergeau
On Thu, Nov 19, 2015 at 12:48:17PM -0500, Marc-André Lureau wrote: > Note that all spice_return*_if_fail() in spice-common should be safe > to move to g_return_if_fail() when I did the conversion (spice-gtk > doesn't use fatal spice_return) Actually, I realized today that spice-gtk does *not* buil

Re: [Spice-devel] Loop, glib and spice-server

2016-01-26 Thread Jonathon Jongsma
Just a few initial comments, questions, below On Mon, 2016-01-25 at 07:35 -0500, Frediano Ziglio wrote: > Hi, > I spent quite some time trying to understand the main loop of spice-server. > (Perhaps I'm tired of rebasing the glib loop patches after 250 patches!) > > There were quite some questi

Re: [Spice-devel] [spice-common v4 7/7] log: Introduce spice_assert_if_fail

2016-01-26 Thread Christophe Fergeau
On Tue, Jan 26, 2016 at 08:16:20AM -0500, Frediano Ziglio wrote: > Why instead you merge the other patches and split this one removing that > macro definition? I've now pushed this series up to "log: Kill spice_warn_if" Christophe signature.asc Description: PGP signature ___

[Spice-devel] [PATCH] qxl: inline documentation for get_command and req_cmd_notification

2016-01-26 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/spice-qxl.h | 5 + 1 file changed, 5 insertions(+) diff --git a/server/spice-qxl.h b/server/spice-qxl.h index e1f14e7..55b164a 100644 --- a/server/spice-qxl.h +++ b/server/spice-qxl.h @@ -166,7 +166,12 @@ struct QXLInterface { void (*set_mm_time

[Spice-devel] [PATCH] worker: simplify process loops

2016-01-26 Thread Frediano Ziglio
It was not clear when req_cmd_notification was called. This code reproduce just the old behavior but is easier to read. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 28 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/server/red-worker.c b/

Re: [Spice-devel] Loop, glib and spice-server

2016-01-26 Thread Frediano Ziglio
> > Hi, > I spent quite some time trying to understand the main loop of spice-server. > (Perhaps I'm tired of rebasing the glib loop patches after 250 patches!) > > There were quite some questions on the loop and the patches left: > - why new code using glib is doing much more iterations? > - w

Re: [Spice-devel] Loop, glib and spice-server

2016-01-26 Thread Frediano Ziglio
> > Just a few initial comments, questions, below > > On Mon, 2016-01-25 at 07:35 -0500, Frediano Ziglio wrote: > > Hi, > > I spent quite some time trying to understand the main loop of > > spice-server. > > (Perhaps I'm tired of rebasing the glib loop patches after 250 patches!) > > > > The

[Spice-devel] [PATCH] small spice_strdup optimization

2016-01-26 Thread Frediano Ziglio
avoid to compute the string length twice and use memcpy instead of strcpy which is faster not having to check for terminator. Signed-off-by: Frediano Ziglio --- common/mem.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/mem.c b/common/mem.c index 2fda6f3..e430b

[Spice-devel] [PATCH] remove wrong statement terminator from preprocessor macro

2016-01-26 Thread Frediano Ziglio
Actually not causing problems as when used is always followed by another terminator but better to fix the definition. Signed-off-by: Frediano Ziglio --- common/lz_compress_tmpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lz_compress_tmpl.c b/common/lz_compress_tm

Re: [Spice-devel] [PATCH] remove wrong statement terminator from preprocessor macro

2016-01-26 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2016-01-26 at 16:36 +, Frediano Ziglio wrote: > Actually not causing problems as when used is always followed by another > terminator but better to fix the definition. > > Signed-off-by: Frediano Ziglio > --- > common/lz_compress_tmpl.c | 2 +- > 1 file

Re: [Spice-devel] [PATCH] small spice_strdup optimization

2016-01-26 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Tue, 2016-01-26 at 16:36 +, Frediano Ziglio wrote: > avoid to compute the string length twice and use memcpy instead of > strcpy which is faster not having to check for terminator. > > Signed-off-by: Frediano Ziglio > --- > common/mem.c | 6 -- > 1 file

[Spice-devel] Developers for virgl 3d windows guest support

2016-01-26 Thread Fabio Fantoni
I take a fast look to virgl 3d project even if I not tested it for now. It seems interesting for adding 2d and 3d hw acceleration support to virtual machines with a large hw (gpu) choice. I take a look also to intel gvt-g but it has a very limited cpu support choice. I saw that windows guest sup

Re: [Spice-devel] Loop, glib and spice-server

2016-01-26 Thread Jonathon Jongsma
On Tue, 2016-01-26 at 11:14 -0500, Frediano Ziglio wrote: > > > > Hi, > > I spent quite some time trying to understand the main loop of spice > > -server. > > (Perhaps I'm tired of rebasing the glib loop patches after 250 patches!) > > > > There were quite some questions on the loop and the pat

[Spice-devel] [PATCH v2] qxl: inline documentation for get_command and req_cmd_notification

2016-01-26 Thread Jonathon Jongsma
From: Frediano Ziglio Signed-off-by: Frediano Ziglio Signed-off-by: Jonathon Jongsma --- Good idea. Here's a proposed re-wording of the documentation. Changes: - for get_command(), I changed the verb from 'request' to 'retrieve' to make it (I think) a bit more clear that it's getting the

Re: [Spice-devel] need advice

2016-01-26 Thread Uri Lublin
On 01/26/2016 02:11 PM, Baurzhan Konurbayev wrote: Thanks for the reply. We would like to try hardware acceleration for our thin clients and therefore, tried to apply the patch called "Add GStreamer support for video streaming", https://patchwork.freedesktop.org/series/1874/ Hi, There is a n

Re: [Spice-devel] [PATCH v2] qxl: inline documentation for get_command and req_cmd_notification

2016-01-26 Thread Uri Lublin
On 01/26/2016 10:26 PM, Jonathon Jongsma wrote: From: Frediano Ziglio Signed-off-by: Frediano Ziglio Signed-off-by: Jonathon Jongsma --- Good idea. Here's a proposed re-wording of the documentation. Changes: - for get_command(), I changed the verb from 'request' to 'retrieve' to make

[Spice-devel] [PATCH v3] qxl: inline documentation for get_command and req_cmd_notification

2016-01-26 Thread Jonathon Jongsma
From: Frediano Ziglio Signed-off-by: Frediano Ziglio Signed-off-by: Jonathon Jongsma --- Changes: - add some newlines - fix documentation for return of get_command server/spice-qxl.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/server/spice-qxl.h b/server/spice-qxl.h ind