Re: [Spice-devel] [PATCH spice-gtk 0/2] Allow to change the preferred compression on the fly

2015-11-17 Thread Pavel Grunt
On Wed, 2015-11-11 at 09:48 +0100, Victor Toso wrote: > Hi, > > On Tue, Nov 10, 2015 at 05:44:05PM +0100, Pavel Grunt wrote: > > Hi, > > > > this series adds new public function for changing the preferred image > > compression. > > The new function is used in spicy under Option -> Preferred Image

[Spice-devel] [PATCH spice-gtk] file transfer: vdagent need a cancel msg when user cancel a file tranfser

2015-11-17 Thread Jay.han
According to vdagent fileXfer, it requires a VD_AGENT_FILE_XFER_STATUS_CANCELLED msg when user cancel a file transfer. Currently our code only send VD_AGENT_FILE_XFER_STATUS_ERROR, this will cause the vdagent lock the file until it restart, you can't remove the broken file. diff --git a/src/channe

[Spice-devel] [PATCH 1/3] Rename red_display_free_* to dcc_free_*

2015-11-17 Thread Jonathon Jongsma
--- server/red_worker.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index 8e3be51..4f1d481 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -289,7 +289,7 @@ static void red_freeze_glz(DisplayCha

[Spice-devel] [PATCH 0/3] split patch 9/9

2015-11-17 Thread Jonathon Jongsma
There wasn't as much to split as I thought there would be, but I think it's still worth considering these changes separately. Jonathon Jongsma (2): Rename red_display_free_* to dcc_free_* Don't abort if encoder cannot be created Marc-André Lureau (1): worker: move encoders to dcc-encoders

[Spice-devel] [PATCH 2/3] worker: move encoders to dcc-encoders

2015-11-17 Thread Jonathon Jongsma
From: Marc-André Lureau Author:Marc-André Lureau --- server/Makefile.am | 2 + server/dcc-encoders.c| 419 server/dcc-encoders.h| 153 + server/display-channel.c | 6 +- server/display-channel.h | 74 ++- server/red_wor

[Spice-devel] [PATCH 3/3] Don't abort if encoder cannot be created

2015-11-17 Thread Jonathon Jongsma
Instead of using spice_critical() when an encoder cannot be created, use a warning so that the server doesn't abort. --- server/dcc-encoders.c | 24 +--- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c index 35edd41..

Re: [Spice-devel] [PATCH 9/9] worker: move encoders to dcc-encoders

2015-11-17 Thread Jonathon Jongsma
This commit mostly just moves code to a separate file, but it also includes a couple changes: Converts several critical messages to warnings. moves some data from RedWorker to DisplayChannelClient (e.g. jpeg_data). As such, I think it's worth splitting this into separate commits so that we can rev

Re: [Spice-devel] [PATCH 8/9] worker: simplify RedCompressBuf

2015-11-17 Thread Jonathon Jongsma
On Tue, 2015-11-17 at 16:37 +, Frediano Ziglio wrote: > From: Marc-André Lureau > > Make sure an allocated buffer is correctly referenced by the marshaller, > and can't be free and reused by mistake. Simplify the code by using > GSlice > --- > server/display-channel.h | 3 -- > server/red_

Re: [Spice-devel] [PATCH 7/9] worker: painfully move display_channel_add_drawable

2015-11-17 Thread Jonathon Jongsma
Alternate version of this patch sent (and ACKed) in the earlier thread. see http://lists.freedesktop.org/archives/spice-devel/2015-November/023703.html On Tue, 2015-11-17 at 16:37 +, Frediano Ziglio wrote: > From: Marc-André Lureau > > --- > server/display-channel.c | 526 +

Re: [Spice-devel] [PATCH 6/9] Move stream creation and maintenance functions to stream.[ch]

2015-11-17 Thread Jonathon Jongsma
I think Fabiano already ACKed this one. It just has a slightly more explicit commit log subject now. On Tue, 2015-11-17 at 16:37 +, Frediano Ziglio wrote: > From: Jonathon Jongsma > > --- > server/display-channel.h | 5 + > server/red_worker.c | 375 +

Re: [Spice-devel] [PATCH 5/9] worker: move stream_agent_stop and friends

2015-11-17 Thread Jonathon Jongsma
ACK On Tue, 2015-11-17 at 16:37 +, Frediano Ziglio wrote: > From: Marc-André Lureau > > --- > server/display-channel.h | 2 + > server/red_worker.c | 178 +- > - > server/stream.c | 174 +

Re: [Spice-devel] [PATCH 9/9] worker: painfully move display_channel_add_drawable

2015-11-17 Thread Jonathon Jongsma
ACK We can revisit the print_stats() issue later if necessary. On Tue, 2015-11-17 at 13:20 -0500, Frediano Ziglio wrote: > --- > server/display-channel.c | 538 > server/display-channel.h | 11 + > server/red_worker.c | 566 ++--

Re: [Spice-devel] [PATCH spice-gtk] Fix use after free of uri

2015-11-17 Thread Jonathon Jongsma
ACK On Tue, 2015-11-17 at 18:55 +0100, Marc-André Lureau wrote: > "path" points to "uri" memory, move free(uri) later. > > Found thanks to valgrind :) > > Signed-off-by: Marc-André Lureau > --- > src/spice-session.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/

[Spice-devel] [PATCH spice-common 2/2] Add GL scanout channel structure

2015-11-17 Thread Marc-André Lureau
See related protocol changes. Signed-off-by: Marc-André Lureau --- common/messages.h | 16 1 file changed, 16 insertions(+) diff --git a/common/messages.h b/common/messages.h index 5f5de54..2a5fabb 100644 --- a/common/messages.h +++ b/common/messages.h @@ -634,6 +634,22 @@ type

[Spice-devel] [PATCH spice-common 1/2] marshaller: learn to describe fd passing in messages

2015-11-17 Thread Marc-André Lureau
The marshaller can't serialize fd in memory stream. Instead, append the fd to the marshaller structure. The marshaller user is responsible for sending the fd when the message is sent. The fd to send can be retrieved with spice_marshaller_get_fd(). Note: only a single fd is supported with this API,

Re: [Spice-devel] [PATCH 9/9] worker: painfully move display_channel_add_drawable

2015-11-17 Thread Frediano Ziglio
--- server/display-channel.c | 538 server/display-channel.h | 11 + server/red_worker.c | 566 ++- server/red_worker.h | 1 + 4 files changed, 570 insertions(+), 546 deletions(-) diff --git a/s

Re: [Spice-devel] [PATCH 9/9] worker: painfully move display_channel_add_drawable

2015-11-17 Thread Frediano Ziglio
I generated a diff without the move, see http://pastebin.com/4G6BtBff > > On Fri, 2015-11-13 at 10:29 -0600, Jonathon Jongsma wrote: > > From: Marc-André Lureau > > > > --- > > server/display-channel.c | 526 > > > > server/display-channel.h | 15

[Spice-devel] [PATCH spice-protocol 1/2] marshaller: learn to describe fd passing in messages

2015-11-17 Thread Marc-André Lureau
Add a new type, "unix_fd", used to describe file descriptor sharing via socket ancillary data (these messages are local only). The marshaller/demarshaller can't serialize this in memory (consume_fd implementation is empty), so it is the responsability of the marshaller user to handle sending and r

[Spice-devel] [PATCH spice-protocol 2/2] Add unix GL scanout messages

2015-11-17 Thread Marc-André Lureau
Add 2 new messages to the display channel to stream pre-rendered GL images of the display. This is only possible when the client supports SPICE_DISPLAY_CAP_GL_SCANOUT capability. The first message, SPICE_MSG_DISPLAY_GL_SCANOUT_UNIX, sends a gl image file handle via socket ancillary data, and can b

[Spice-devel] [PATCH spice-gtk] Fix use after free of uri

2015-11-17 Thread Marc-André Lureau
"path" points to "uri" memory, move free(uri) later. Found thanks to valgrind :) Signed-off-by: Marc-André Lureau --- src/spice-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spice-session.c b/src/spice-session.c index c673fa2..a36dcea 100644 --- a/src/spice-s

Re: [Spice-devel] [PATCH 1/9] Move some tree item functions to tree.[ch]

2015-11-17 Thread Jonathon Jongsma
ACK On Tue, 2015-11-17 at 12:07 -0500, Frediano Ziglio wrote: > Also rename some functions slightly: > __find_shadow -> tree_item_find_shadow() > __contained_by -> tree_item_contained_by() > ring_of -> tree_item_container_items(); > > Acked-by: Fabiano Fidêncio > --- > server/red

Re: [Spice-devel] [PATCH 1/9] Move some tree item functions to tree.[ch]

2015-11-17 Thread Frediano Ziglio
Also rename some functions slightly: __find_shadow -> tree_item_find_shadow() __contained_by -> tree_item_contained_by() ring_of -> tree_item_container_items(); Acked-by: Fabiano Fidêncio --- server/red_worker.c | 62 ++--- server/tr

Re: [Spice-devel] [PATCH 1/9] Move some tree item functions to tree.[ch]

2015-11-17 Thread Jonathon Jongsma
Hmm, it doesn't seem that this patch changed since the last version you sent. Except some of the context is slightly different, perhaps because of re -ordering? (e.g. exclude_region has a RedWorker* as the first parameter in this patch. In the previous patch, it had DisplayChannel* as the first par

[Spice-devel] [PATCH 9/9] worker: move encoders to dcc-encoders

2015-11-17 Thread Frediano Ziglio
From: Marc-André Lureau Author:Marc-André Lureau --- server/Makefile.am | 2 + server/dcc-encoders.c| 405 + server/dcc-encoders.h| 153 + server/display-channel.c | 6 +- server/display-channel.h | 74 ++ server/red_worker.

[Spice-devel] [PATCH 8/9] worker: simplify RedCompressBuf

2015-11-17 Thread Frediano Ziglio
From: Marc-André Lureau Make sure an allocated buffer is correctly referenced by the marshaller, and can't be free and reused by mistake. Simplify the code by using GSlice --- server/display-channel.h | 3 -- server/red_worker.c | 111 +++ 2 fil

[Spice-devel] [PATCH 6/9] Move stream creation and maintenance functions to stream.[ch]

2015-11-17 Thread Frediano Ziglio
From: Jonathon Jongsma --- server/display-channel.h | 5 + server/red_worker.c | 375 +-- server/stream.c | 359 + server/stream.h | 9 ++ 4 files changed, 378 insertions(+), 370 de

[Spice-devel] [PATCH 7/9] worker: painfully move display_channel_add_drawable

2015-11-17 Thread Frediano Ziglio
From: Marc-André Lureau --- server/display-channel.c | 526 +++ server/display-channel.h | 15 +- server/red_worker.c | 566 ++- server/red_worker.h | 1 + 4 files changed, 560 insertions(+), 548 del

[Spice-devel] [PATCH 5/9] worker: move stream_agent_stop and friends

2015-11-17 Thread Frediano Ziglio
From: Marc-André Lureau --- server/display-channel.h | 2 + server/red_worker.c | 178 +-- server/stream.c | 174 + server/stream.h | 3 + 4 files changed, 180 insertions(+), 177 de

[Spice-devel] [PATCH 1/9] Move some tree item functions to tree.[ch]

2015-11-17 Thread Frediano Ziglio
From: Jonathon Jongsma Also rename some functions slightly: __find_shadow -> tree_item_find_shadow() __contained_by -> tree_item_contained_by() ring_of -> tree_item_container_items(); Acked-by: Fabiano Fidêncio --- server/red_worker.c | 62 ++-

[Spice-devel] [PATCH 0/9] Backported some patches from refactory branches (17th Nov)

2015-11-17 Thread Frediano Ziglio
This patchset supersedes last patchset. Changes: - rebased; - added "worker: move stream_agent_stop and friends" and merged with "Move dcc_create_stream to display channel"; - merged "Add red_worker_get_clockid()" back; - added back some patches waiting for some author confirmation. I removed n

Re: [Spice-devel] [PATCH 10/11] Move stream functions to stream.[ch]

2015-11-17 Thread Jonathon Jongsma
On Tue, 2015-11-17 at 08:59 -0500, Frediano Ziglio wrote: > > > > On Mon, 2015-11-16 at 15:02 +0100, Fabiano Fidêncio wrote: > > > On Mon, Nov 16, 2015 at 12:06 PM, Frediano Ziglio > > > wrote: > > > > From: Jonathon Jongsma > > > > > > > > --- > > > > server/display-channel.h | 5 + > > > >

Re: [Spice-devel] Refactory and spaghetti code

2015-11-17 Thread Jonathon Jongsma
On Tue, 2015-11-17 at 15:50 +0100, Christophe Fergeau wrote: > On Tue, Nov 17, 2015 at 07:27:22AM -0500, Frediano Ziglio wrote: > > Cfr https://en.wikipedia.org/wiki/Spaghetti and > > https://en.wikipedia.org/wiki/Spaghetti_code! > > > > As today part of the team involved in the refactoring review

Re: [Spice-devel] [PATCH 09/11] Move dcc_create_stream to display channel

2015-11-17 Thread Frediano Ziglio
> > On Mon, 2015-11-16 at 13:20 +0100, Pavel Grunt wrote: > > Hi, > > > > it is not moved, it is just making it public. Can it be moved from > > red_worker.c? > > > Yeah, this is another commit that I debated whether to separate or not, and > also > debated whether to actually move the implemen

Re: [Spice-devel] Refactory and spaghetti code

2015-11-17 Thread Christophe Fergeau
On Tue, Nov 17, 2015 at 07:27:22AM -0500, Frediano Ziglio wrote: > Cfr https://en.wikipedia.org/wiki/Spaghetti and > https://en.wikipedia.org/wiki/Spaghetti_code! > > As today part of the team involved in the refactoring review is on holiday I > started looking at the average direction and state o

[Spice-devel] [PATCH] worker: simplify red_marshall_image

2015-11-17 Thread Frediano Ziglio
Remove some nested blocks using else if. Signed-off-by: Frediano Ziglio --- server/red_worker.c | 34 +++--- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index 3a718fd..986908d 100644 --- a/server/red_worker

Re: [Spice-devel] [PATCH 10/11] Move stream functions to stream.[ch]

2015-11-17 Thread Frediano Ziglio
> > On Mon, 2015-11-16 at 15:02 +0100, Fabiano Fidêncio wrote: > > On Mon, Nov 16, 2015 at 12:06 PM, Frediano Ziglio > > wrote: > > > From: Jonathon Jongsma > > > > > > --- > > > server/display-channel.h | 5 + > > > server/red_worker.c | 376 > > > +

[Spice-devel] [RFC PATH 1/2] stat: use a better design for statistic functions

2015-11-17 Thread Frediano Ziglio
make sure code compile with statistics enabled or disabled. Dummy (empty) structures and functions are used instead of preprocessor. Also fix a problem as stat_compress_init did not initialize clock field. Signed-off-by: Frediano Ziglio --- server/display-channel.c | 2 -- server/display-channe

[Spice-devel] [RFC PATH 0/2] Improve statistic code

2015-11-17 Thread Frediano Ziglio
Mainly this set of patches try to reduce usage of preprocessor and retaining optimization. This make possible to check code (beside code that print statistics) with single set of configure options. Patch is still RFC for different reasons: - compress and normal statistics are not separate and st

[Spice-devel] [RFC PATH 2/2] stat: add test for statistic functions

2015-11-17 Thread Frediano Ziglio
Make sure code compile with and without statistics enabled (beside printing functions). Signed-off-by: Frediano Ziglio --- server/tests/.gitignore | 5 +++ server/tests/Makefile.am | 35 server/tests/stat-main.c | 49 server/tests/stat-test.c |

[Spice-devel] Refactory and spaghetti code

2015-11-17 Thread Frediano Ziglio
Cfr https://en.wikipedia.org/wiki/Spaghetti and https://en.wikipedia.org/wiki/Spaghetti_code! As today part of the team involved in the refactory review is on holiday I started looking at the average direction and state of this refactory. I looked at different angles like: 1- where we are; 2- wha