Re: [Spice-devel] [PATCH 1/2] Ensure that plugins cannot bypass version check

2018-04-18 Thread Lukáš Hrázký
On Tue, 2018-04-17 at 10:12 -0400, Frediano Ziglio wrote: > > > > From: Christophe de Dinechin > > > > This change addresses three issues related to plugin version checking: > > > > 1. It is possible for plugins to bypass version checking or do it wrong > >(as a matter of fact, the mjpeg fa

Re: [Spice-devel] [PATCH 1/2] Ensure that plugins cannot bypass version check

2018-04-18 Thread Christophe de Dinechin
> On 17 Apr 2018, at 20:11, Frediano Ziglio wrote: > >>> >>> On 17 Apr 2018, at 16:12, Frediano Ziglio wrote: >>> From: Christophe de Dinechin This change addresses three issues related to plugin version checking: 1. It is possible for plugins to bypass vers

Re: [Spice-devel] [PATCH spice-server 2/3] red-stream: Implements flush using TCP_CORK

2018-04-18 Thread Uri Lublin
On 04/17/2018 08:50 PM, Frediano Ziglio wrote: On 04/13/2018 03:25 PM, Frediano Ziglio wrote: Cork is a system interface implemented by Linux and some *BSD systems to tell the system that other data are expected to be written to a socket. This allows the system to reduce network fragmentation w

[Spice-devel] [PATCH spice-streaming-agent 0/3] Split plugin version check patch

2018-04-18 Thread Frediano Ziglio
This patchset just split previous series to be able to discuss separate changes. Christophe de Dinechin (3): Ensure that plugins cannot bypass version check Change numbering schema Add a macro to deal with the boilerplate of writing a streaming agent plugin include/spice-streaming-agen

[Spice-devel] [PATCH spice-streaming-agent 1/3] Ensure that plugins cannot bypass version check

2018-04-18 Thread Frediano Ziglio
From: Christophe de Dinechin This change addresses two issues related to plugin version checking: 1. It is possible for plugins to bypass version checking or do it wrong (as a matter of fact, the mjpeg fallback sets a bad example) 2. The current plugin version check violates the C++ ODR, i.e

[Spice-devel] [PATCH spice-streaming-agent 2/3] Change numbering schema

2018-04-18 Thread Frediano Ziglio
From: Christophe de Dinechin A major.minor numbering scheme is not ideal for ABI checks. In particular, it makes it difficult to react to an incompatibility that was detected post release. [More info] The major.minor numbering scheme initially selected makes it harder to fixes cases where an in

[Spice-devel] [PATCH spice-streaming-agent 3/3] Add a macro to deal with the boilerplate of writing a streaming agent plugin

2018-04-18 Thread Frediano Ziglio
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- include/spice-streaming-agent/plugin.hpp | 8 1 file changed, 8 insertions(+) diff --git a/include/spice-streaming-agent/plugin.hpp b/include/spice-streaming-agent/plugin.hpp index 0ec5040..b01cd82 100644 --- a/in

Re: [Spice-devel] [PATCH spice-server 2/3] red-stream: Implements flush using TCP_CORK

2018-04-18 Thread Frediano Ziglio
> > On 04/17/2018 08:50 PM, Frediano Ziglio wrote: > >> > >> On 04/13/2018 03:25 PM, Frediano Ziglio wrote: > >>> Cork is a system interface implemented by Linux and some *BSD systems to > >>> tell the system that other data are expected to be written to a socket. > >>> This allows the system to r

Re: [Spice-devel] [spice-gtk v1 05/11] channel-display: add spice_frame_free() helper

2018-04-18 Thread Victor Toso
Hi, Many thanks for the reviews. On Tue, Apr 17, 2018 at 07:08:13AM -0400, Frediano Ziglio wrote: > > > > From: Victor Toso > > > > The SpiceFrame is created in channel-display.c but it is currently > > freed at each decoders' end. A helper function can reduce some code > > and makes it easier

[Spice-devel] [PATCH spice-gtk] build: Generate correct version when spice-gtk is a submodule

2018-04-18 Thread Christophe de Dinechin
From: Christophe de Dinechin When spice-gtk is a submodule, .git is not a directory but a file. Testing for a file avoids an "UNKNOWN" version Signed-off-by: Christophe de Dinechin --- build-aux/git-version-gen | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-aux/g

Re: [Spice-devel] [spice-gtk v1 06/11] channel-display: add spice_frame_new() helper

2018-04-18 Thread Victor Toso
On Tue, Apr 17, 2018 at 07:10:43AM -0400, Frediano Ziglio wrote: > > > From: Victor Toso > > > > As it makes easier to track what is allocated in its own function and > > ultimately what needs to be freed later on. > > > > Signed-off-by: Victor Toso > > --- > > src/channel-display.c | 30

Re: [Spice-devel] [spice-gtk v1 09/11] channel-display: don't debug latency for each frame

2018-04-18 Thread Victor Toso
On Tue, Apr 17, 2018 at 07:46:42AM -0400, Frediano Ziglio wrote: > > > > From: Victor Toso > > > > Becomes quite hard to find meaning on something that is printed every > > time. Only print latency value if it is a new min/max or if average > > latency is 10% bigger/lower then usual. > > > > No

Re: [Spice-devel] [spice-gtk v1 10/11] channel-display-gst: summarize number of frames dropped

2018-04-18 Thread Victor Toso
Hi, On Tue, Apr 17, 2018 at 07:38:22AM -0400, Frediano Ziglio wrote: > > > > From: Victor Toso > > > > For example, this has produced 9 lines of debug below instead of 31. > > > > GSpice-DEBUG: channel-display-gst.c:247 the GStreamer pipeline dropped 4 > > frames > > GSpice-DEBUG: channel-disp

Re: [Spice-devel] [PATCH spice-gtk] spice-channel: Use atomic operations for SpiceMsgIn::refcount

2018-04-18 Thread Victor Toso
Hi, On Tue, Apr 17, 2018 at 09:45:10AM -0400, Frediano Ziglio wrote: > > > > On Tue, Apr 17, 2018 at 01:32:53PM +0100, Frediano Ziglio wrote: > > > This structure is potentially used in multiple thread. > > > Currently in Gstreamer thread using streaming data and coroutine > > > thread. > > > >

Re: [Spice-devel] [PATCH spice-gtk] build: Generate correct version when spice-gtk is a submodule

2018-04-18 Thread Christophe Fergeau
Hey, This script comes from https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/git-version-gen;h=6d073fcaddd827a396af4c52f1bf00bdd84a9f66;hb=HEAD where this issue might already be fixed, the line that you changed seems to be replaced by: elif test "`git log -1 --pretty=format:x

Re: [Spice-devel] [PATCH 1/2] Ensure that plugins cannot bypass version check

2018-04-18 Thread Christophe Fergeau
On Tue, Apr 17, 2018 at 06:39:05PM +0200, Christophe de Dinechin wrote: > When does this kind of scenario happen? Imagine we added support for > loading/unloading plugins. Version 13 adds a new interface to unload > plugins, and a new “unloadable plugin” entry point. Therefore, > starting with vers

[Spice-devel] [spice-gtk v1] channel-display: always name GHashFunc and GEqualFunc

2018-04-18 Thread Victor Toso
From: Victor Toso g_hash_table_new() allows to pass NULL for GHashFunc and GEqualFunc which defaults to g_direct_hash() and g_direct_equal(). This is the only place in our code that uses NULL while in channel-main and channel-smartcard and spice-file-transfer-task we name it. Changing for consi

[Spice-devel] [spice-server v1] tests: add test-listen executable to gitignore

2018-04-18 Thread Victor Toso
From: Victor Toso Signed-off-by: Victor Toso --- server/tests/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/server/tests/.gitignore b/server/tests/.gitignore index ccd5fe10..db26b3ee 100644 --- a/server/tests/.gitignore +++ b/server/tests/.gitignore @@ -13,6 +13,7 @@ test-displ

Re: [Spice-devel] [spice-server v1] tests: add test-listen executable to gitignore

2018-04-18 Thread Frediano Ziglio
> > From: Victor Toso > > Signed-off-by: Victor Toso > --- > server/tests/.gitignore | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/server/tests/.gitignore b/server/tests/.gitignore > index ccd5fe10..db26b3ee 100644 > --- a/server/tests/.gitignore > +++ b/server/tests/.gitignore > @

Re: [Spice-devel] [spice-gtk v1] channel-display: always name GHashFunc and GEqualFunc

2018-04-18 Thread Frediano Ziglio
> > From: Victor Toso > > g_hash_table_new() allows to pass NULL for GHashFunc and GEqualFunc > which defaults to g_direct_hash() and g_direct_equal(). > > This is the only place in our code that uses NULL while in > channel-main and channel-smartcard and spice-file-transfer-task we > name it.

[Spice-devel] [spice-gtk v1 0/4] Add a max-num-streams in protocol

2018-04-18 Thread Victor Toso
From: Victor Toso Hi, As discussed [0], let's add a well defined value for max number of concurrent streams that we might have. This series bumps spice-gtk to unreleased spice-protocol and also breaks abi of spice-server. Let me know your thoughts on it. [0] https://lists.freedesktop.org/archi

[Spice-devel] [spice-protocol v1 1/4] streaming: define max of number of concurrent streams

2018-04-18 Thread Victor Toso
From: Victor Toso This definition is lacking in client while in server it is hardcoded to 50. Having a well defined limitation allow us to make the code more robust and optimized. Signed-off-by: Victor Toso --- spice/protocol.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spice/protoc

[Spice-devel] [spice-gtk v1 4/4] channel-display: Limit number of streams that can be created

2018-04-18 Thread Victor Toso
From: Victor Toso Using the limit SPICE_MAX_NUM_STREAMS introduced in spice-protocol 0.12.14 to fix the amount of streams we might be working currently. With this change, let's create the streams array on _init() and free it on _finalize() to avoid dealing with too many checks everywhere. Note

[Spice-devel] [spice-common v1 2/4] messages: document limitation of id in StreamCreate

2018-04-18 Thread Victor Toso
From: Victor Toso Note that the ID limitation always existed but now we have the limitation in the protocol itself with SPICE_MAX_NUM_STREAMS Signed-off-by: Victor Toso --- common/messages.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/messages.h b/common/messages

[Spice-devel] [spice-server v1 3/4] display-limits: use SPICE_MAX_NUM_STREAMS from protocol

2018-04-18 Thread Victor Toso
From: Victor Toso Using the limit SPICE_MAX_NUM_STREAMS introduced in spice-protocol 0.12.14 to fix the amount of streams we might be working currently. This change removes the NUM_STREAMS define in display-limits.h This is an ABI break patch as the size of some arrays will change such as: - st