Re: [Spice-devel] [PATCH spice-server 1/4] Release cursor as soon as possible

2017-09-06 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2017-09-06 at 18:15 +0100, Frediano Ziglio wrote: > Cursor resources (basically the shape of it) was retained till > it was used however it was copied so there were no reason to not > release > this resource. > > Signed-off-by: Frediano Ziglio > --- > server

Re: [Spice-devel] [PATCH spice-server 4/4] common-graphics-channel: Move "qxl" property to DisplayChannel

2017-09-06 Thread Jonathon Jongsma
Hardly any reason for the CommonGraphicsChannel anymore Acked-by: Jonathon Jongsma On Wed, 2017-09-06 at 18:15 +0100, Frediano Ziglio wrote: > Only DisplayChannel uses this property. > > Signed-off-by: Frediano Ziglio > --- > server/common-graphics-channel.c | 62 ---

Re: [Spice-devel] [PATCH spice-server 3/4] cursor-channel: Remove dependency from QXL

2017-09-06 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2017-09-06 at 18:15 +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/cursor-channel.c | 5 ++--- > server/cursor-channel.h | 4 ++-- > server/red-worker.c | 2 +- > 3 files changed, 5 insertions(+), 6 deletions(-) > > diff --

Re: [Spice-devel] [PATCH spice-server 2/4] cursor-channel: Removed unused qxl field from RedCursorPipeItem

2017-09-06 Thread Jonathon Jongsma
Not sure that this really needs to be split from the previous patch, but OK Acked-by: Jonathon Jongsma On Wed, 2017-09-06 at 18:15 +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/cursor-channel.c | 8 ++-- > 1 file changed, 2 insertions(+), 6 deletions(-) >

Re: [Spice-devel] [PATCH spice-server v2 3/3] Fix crash attempting to connect duplicate channels

2017-09-06 Thread Jonathon Jongsma
On Wed, 2017-08-30 at 10:36 +0100, Frediano Ziglio wrote: > You could easily trigger this issue using multiple monitors and > a modified spice-gtk client with this patch: > > --- a/src/channel-main.c > +++ b/src/channel-main.c > @@ -1699,6 +1699,7 @@ static gboolean _channel_new(channel_new_t *c)

Re: [Spice-devel] [PATCH spice-server v2 1/3] dcc: Fix NULL pointer dereference attempting to connect duplicate channels

2017-09-06 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2017-08-30 at 10:36 +0100, Frediano Ziglio wrote: > You could easily trigger this issue using multiple monitors and > a modified spice-gtk client with this patch: > > --- a/src/channel-main.c > +++ b/src/channel-main.c > @@ -1699,6 +1699,7 @@ static gboolean

[Spice-devel] [PATCH spice-server 2/2] Add documentation for Dispatcher

2017-09-06 Thread Jonathon Jongsma
--- server/dispatcher.h | 102 +--- 1 file changed, 82 insertions(+), 20 deletions(-) diff --git a/server/dispatcher.h b/server/dispatcher.h index eb93c1358..ed3ecf6bb 100644 --- a/server/dispatcher.h +++ b/server/dispatcher.h @@ -35,6 +35,18 @@ typ

[Spice-devel] [PATCH spice-server 1/2] Dispatcher: remove async_done callback

2017-09-06 Thread Jonathon Jongsma
This callback was only executed for message types that were registered with DISPATCHER_ASYNC ack type. However, the async_done handler was called immediately after the message-specific handler and was called in the same thread, so the async_done stuff can just as easily be done from within the mess

Re: [Spice-devel] [PATCH spice-server] EXPERIMENTAL: Remove DISPATCHER_ASYNC

2017-09-06 Thread Jonathon Jongsma
So I didn't know you were going to do this and after lunch I basically implemented the same thing and sent it without noticing this patch :/ Anyway, since then I made a couple of changes and rebased it before the documentation patch. I'll send an updated patch series. On Wed, 2017-09-06 at 18:40

Re: [Spice-devel] [PATCH spice-server] RFC: Remove DISPATCHER_ASYNC type

2017-09-06 Thread Jonathon Jongsma
And apparently I didn't look at mail for a while and Frediano decided to do the same thing after our little discussion... On Wed, 2017-09-06 at 14:03 -0500, Jonathon Jongsma wrote: > --- > > From a previous conversation: > On Wed, 2017-09-06 at 13:14 -0400, Frediano Ziglio wrote: > > > [OT: it's

[Spice-devel] [PATCH spice-server] RFC: Remove DISPATCHER_ASYNC type

2017-09-06 Thread Jonathon Jongsma
--- From a previous conversation: On Wed, 2017-09-06 at 13:14 -0400, Frediano Ziglio wrote: > > [OT: it's a little bit unclear to me why the async_done handler is > > necessary at all. It is called immediately after the message- > > specific > > handler is called, and it is called from the same th

[Spice-devel] [PATCH spice-server] EXPERIMENTAL: Remove DISPATCHER_ASYNC

2017-09-06 Thread Frediano Ziglio
Very quick patch to check Jonathon suggestion, quick tests seems to indicate that it works --- server/dispatcher.c | 11 --- server/dispatcher.h | 16 +--- server/red-worker.c | 52 +--- 3 files changed, 26 insertions(+), 53 delet

[Spice-devel] [PATCH spice-server 3/4] cursor-channel: Remove dependency from QXL

2017-09-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/cursor-channel.c | 5 ++--- server/cursor-channel.h | 4 ++-- server/red-worker.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/server/cursor-channel.c b/server/cursor-channel.c index fad90ad00..a844100a0 100644 --- a/server/c

[Spice-devel] [PATCH spice-server 2/4] cursor-channel: Removed unused qxl field from RedCursorPipeItem

2017-09-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/cursor-channel.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/server/cursor-channel.c b/server/cursor-channel.c index d61cf4808..fad90ad00 100644 --- a/server/cursor-channel.c +++ b/server/cursor-channel.c @@ -30,7 +30,6 @@

[Spice-devel] [PATCH spice-server 1/4] Release cursor as soon as possible

2017-09-06 Thread Frediano Ziglio
Cursor resources (basically the shape of it) was retained till it was used however it was copied so there were no reason to not release this resource. Signed-off-by: Frediano Ziglio --- server/cursor-channel.c | 1 - server/red-worker.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)

[Spice-devel] [PATCH spice-server 4/4] common-graphics-channel: Move "qxl" property to DisplayChannel

2017-09-06 Thread Frediano Ziglio
Only DisplayChannel uses this property. Signed-off-by: Frediano Ziglio --- server/common-graphics-channel.c | 62 server/common-graphics-channel.h | 1 - server/dcc-send.c| 2 +- server/dcc.c | 2 +- server/display-c

Re: [Spice-devel] [PATCH spice-server v2 2/3] Dispatcher: typedef enum for dispatcher flags

2017-09-06 Thread Frediano Ziglio
> > On Wed, 2017-09-06 at 12:35 -0400, Frediano Ziglio wrote: > > > > > > On Wed, 2017-09-06 at 07:47 -0400, Frediano Ziglio wrote: > > > > > > > > > > dispatcher_register_handler() accepts a flag value that > > > > > determines > > > > > whether the message type requires an ACK or async_done ha

Re: [Spice-devel] [PATCH spice-server v2 2/3] Dispatcher: typedef enum for dispatcher flags

2017-09-06 Thread Jonathon Jongsma
On Wed, 2017-09-06 at 12:35 -0400, Frediano Ziglio wrote: > > > > On Wed, 2017-09-06 at 07:47 -0400, Frediano Ziglio wrote: > > > > > > > > dispatcher_register_handler() accepts a flag value that > > > > determines > > > > whether the message type requires an ACK or async_done handler. > > > > Th

Re: [Spice-devel] [PATCH spice-server] Release cursor as soon as possible

2017-09-06 Thread Frediano Ziglio
> > On Wed, Sep 06, 2017 at 01:41:21PM +0100, Frediano Ziglio wrote: > > diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c > > index 33f36923a..fda4ff26d 100644 > > --- a/server/red-parse-qxl.c > > +++ b/server/red-parse-qxl.c > > @@ -26,6 +26,7 @@ > > #include "red-common.h" > > #inc

Re: [Spice-devel] [PATCH spice-server v2 2/3] Dispatcher: typedef enum for dispatcher flags

2017-09-06 Thread Frediano Ziglio
> > On Wed, 2017-09-06 at 07:47 -0400, Frediano Ziglio wrote: > > > > > > dispatcher_register_handler() accepts a flag value that determines > > > whether the message type requires an ACK or async_done handler. > > > This > > > parameter was previously just an int. It is now a typedef'ed enum: >

[Spice-devel] [PATCH spice-server v2 02/15] test-display-base: Protect command ring with a mutex

2017-09-06 Thread Frediano Ziglio
The ring is accessed by multiple thread. Signed-off-by: Frediano Ziglio --- server/tests/test-display-base.c | 29 +++-- 1 file changed, 19 insertions(+), 10 deletions(-) Changes since v1: - moved part to make safe for multiple servers in this patch diff --git a/server/

[Spice-devel] [PATCH spice-server v2 10/15] test-display-base: Always compile with AUTOMATED_TESTS enabled

2017-09-06 Thread Frediano Ziglio
There's no need to not compile this feature, it just enable a parameters which must be passed in order to change test behaviour. Signed-off-by: Frediano Ziglio --- configure.ac | 17 - server/tests/Makefile.am | 4 server/tests/test-display-base.

[Spice-devel] [PATCH spice-server v2 03/15] test-display-base: Avoid usage after free when the wakeup timer is freed

2017-09-06 Thread Frediano Ziglio
The wakeup timer is used by the worker thread and by the main thread. Destroying the object before destroying the worker thread can lead to use after free. Destroying the worker thread first makes sure we don't race. This is detected easily when compiling the test with address sanitizer. Signed-of

[Spice-devel] [PATCH spice-server v2 14/15] tests: Make test-two-servers work

2017-09-06 Thread Frediano Ziglio
This test runs 2 spice server in one program. Use two different tcp port to be able to connect to both servers. Signed-off-by: Frediano Ziglio --- server/tests/test-display-base.c | 8 ++-- server/tests/test-display-base.h | 1 + server/tests/test-two-servers.c | 2 +- 3 files changed, 8 in

Re: [Spice-devel] [PATCH spice-server v2 3/3] Add documentation for Dispatcher

2017-09-06 Thread Jonathon Jongsma
On Wed, 2017-09-06 at 11:23 +0200, Christophe Fergeau wrote: > On Tue, Sep 05, 2017 at 01:51:05PM -0500, Jonathon Jongsma wrote: > > void dispatcher_register_async_done_callback( > > Dispatcher *dispatcher, > > dispatcher_ha

Re: [Spice-devel] [PATCH spice-server v2 2/3] Dispatcher: typedef enum for dispatcher flags

2017-09-06 Thread Jonathon Jongsma
On Wed, 2017-09-06 at 07:47 -0400, Frediano Ziglio wrote: > > > > dispatcher_register_handler() accepts a flag value that determines > > whether the message type requires an ACK or async_done handler. > > This > > parameter was previously just an int. It is now a typedef'ed enum: > > DispatcherFla

Re: [Spice-devel] [PATCH spice-server 05/16] test-display-base: Avoid global buffer overflow

2017-09-06 Thread Frediano Ziglio
> > On Wed, Sep 06, 2017 at 11:54:38AM -0400, Frediano Ziglio wrote: > > > > > > On Mon, Sep 04, 2017 at 11:57:13AM +0100, Frediano Ziglio wrote: > > > > For some reasons (documented in cursor_init) the function > > > > uses 128 bytes more of data causing a reading buffer overflow. > > > > > > 1

Re: [Spice-devel] [PATCH spice-server 05/16] test-display-base: Avoid global buffer overflow

2017-09-06 Thread Christophe Fergeau
On Wed, Sep 06, 2017 at 11:54:38AM -0400, Frediano Ziglio wrote: > > > > On Mon, Sep 04, 2017 at 11:57:13AM +0100, Frediano Ziglio wrote: > > > For some reasons (documented in cursor_init) the function > > > uses 128 bytes more of data causing a reading buffer overflow. > > > > 128 extra bytes of

Re: [Spice-devel] [PATCH spice-server 06/16] test-display-base: Avoid cursor move command leaks

2017-09-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Mon, Sep 04, 2017 at 11:57:14AM +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/tests/test-display-base.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/server/tests/test-display-base.c > b/server/tests/te

Re: [Spice-devel] [PATCH spice-server 10/16] test-display-base: Always compile with AUTOMATED_TESTS enabled

2017-09-06 Thread Frediano Ziglio
> > On Mon, Sep 04, 2017 at 11:57:18AM +0100, Frediano Ziglio wrote: > > There's no need to not compile this feature, it just enable > > a parameters which must be passed in order to change test > > behaviour. > > This could be removed from configure.ac too? > Was also thinking when I saw the

Re: [Spice-devel] [PATCH spice-server 05/16] test-display-base: Avoid global buffer overflow

2017-09-06 Thread Frediano Ziglio
> > On Mon, Sep 04, 2017 at 11:57:13AM +0100, Frediano Ziglio wrote: > > For some reasons (documented in cursor_init) the function > > uses 128 bytes more of data causing a reading buffer overflow. > > 128 extra bytes of data ? > > Acked-by: Christophe Fergeau > There's this comment/code some

Re: [Spice-devel] [PATCH spice-server 14/16] tests: Make test-two-servers work reliably

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 11:57:22AM +0100, Frediano Ziglio wrote: > This test run 2 spice server in one program. "runs" > Use two different tcp port to be able to connect to both servers. > Also fix a race condition getting the command to execute from > the worker threads. I would have put the ra

Re: [Spice-devel] [PATCH spice-server 07/16] test-display-base: Use spice allocation helpers

2017-09-06 Thread Frediano Ziglio
> > On Mon, Sep 04, 2017 at 11:57:15AM +0100, Frediano Ziglio wrote: > > Do not use calloc and malloc directly without checking > > the result. Use instead spice functions to get a nice > > error in case of allocation failures. > > I'd tend to switch to g_new0 and friends rather than spice_xxx...

Re: [Spice-devel] [PATCH spice-server 12/16] tests: Make test-fail-on-null-core-interface an automated test

2017-09-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Mon, Sep 04, 2017 at 11:57:20AM +0100, Frediano Ziglio wrote: > Update to Glib style to catch warning. > Initialize properly the structure (invalid) provided. > Check results of spice_server_init. > Remove leaks. > Enable as check. > > Signed-off-by: Frediano Zig

Re: [Spice-devel] [PATCH spice-server 13/16] tests: Make test-empty-success automated

2017-09-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Mon, Sep 04, 2017 at 11:57:21AM +0100, Frediano Ziglio wrote: > Add some check that something happened during creation/destruction. > Set as running on "make check". > > Signed-off-by: Frediano Ziglio > --- > server/tests/Makefile.am | 2 +- > server/

Re: [Spice-devel] [PATCH spice-server 11/16] tests: Update README

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 11:57:19AM +0100, Frediano Ziglio wrote: > Update tests names. > Remove tetris comments, never available and not planned. > Update some notes. > > Signed-off-by: Frediano Ziglio > --- > server/tests/README | 20 ++-- > 1 file changed, 10 insertions(+), 10

Re: [Spice-devel] [PATCH spice-server 10/16] test-display-base: Always compile with AUTOMATED_TESTS enabled

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 11:57:18AM +0100, Frediano Ziglio wrote: > There's no need to not compile this feature, it just enable > a parameters which must be passed in order to change test > behaviour. This could be removed from configure.ac too? > > Signed-off-by: Frediano Ziglio > --- > serve

Re: [Spice-devel] [PATCH spice-server 09/16] tests: Allow to quit the message loop

2017-09-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Mon, Sep 04, 2017 at 11:57:17AM +0100, Frediano Ziglio wrote: > This allows to end the loop to end some tests. > Currently different tests enter the loop but never exit from > them. > > Signed-off-by: Frediano Ziglio > --- > server/tests/basic-event-loop.c | 11

Re: [Spice-devel] [PATCH spice-server 08/16] test-display-base: Do not assume LP64 architecture on 64 bit

2017-09-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Mon, Sep 04, 2017 at 11:57:16AM +0100, Frediano Ziglio wrote: > In C the sizeof(long) can be different than sizeof(void*), > use proper type. > > Signed-off-by: Frediano Ziglio > --- > server/tests/test-display-base.c | 10 +- > 1 file changed, 5 insert

Re: [Spice-devel] [PATCH spice-server 07/16] test-display-base: Use spice allocation helpers

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 11:57:15AM +0100, Frediano Ziglio wrote: > Do not use calloc and malloc directly without checking > the result. Use instead spice functions to get a nice > error in case of allocation failures. I'd tend to switch to g_new0 and friends rather than spice_xxx... Christophe >

Re: [Spice-devel] [PATCH spice-server 05/16] test-display-base: Avoid global buffer overflow

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 11:57:13AM +0100, Frediano Ziglio wrote: > For some reasons (documented in cursor_init) the function > uses 128 bytes more of data causing a reading buffer overflow. 128 extra bytes of data ? Acked-by: Christophe Fergeau > > Signed-off-by: Frediano Ziglio > --- > Is it

Re: [Spice-devel] [PATCH spice-server 04/16] test-display-base: Protect the wake up timer start with a mutex

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 11:57:12AM +0100, Frediano Ziglio wrote: > Timers in spice server are supposed to be used in a single thread > context. To avoid problems protect the usage from multiple > thread with a mutex. "problems, protect" Acked-by: Christophe Fergeau > This sometimes caused a cra

Re: [Spice-devel] [PATCH spice-server 03/16] test-display-base: Avoid usage after free freeing wakeup timer

2017-09-06 Thread Christophe Fergeau
I'd add a "when" in the shortlog On Mon, Sep 04, 2017 at 11:57:11AM +0100, Frediano Ziglio wrote: > The wakeup timer is used by the worker thread and by the > main thread. > Destroying the object before destroying the worker thread > can lead to use after free. > Destroying the worker thread befor

Re: [Spice-devel] [PATCH spice-server 02/16] test-display-base: Protect command ring with a mutex

2017-09-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Mon, Sep 04, 2017 at 11:57:10AM +0100, Frediano Ziglio wrote: > The ring is accessed by multiple thread. > > Signed-off-by: Frediano Ziglio > --- > server/tests/test-display-base.c | 13 +++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff

Re: [Spice-devel] [PATCH spice-server 01/16] test-display-base: Use unsigned numbers for command ring indexes

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 11:57:09AM +0100, Frediano Ziglio wrote: > As the indexes are used to compute the index inside an array > using module operation when a signed value overflows the "modulo" ... "when a signed value overflows, the modulo becomes negative, causing a buffer overflow" Acked-by:

Re: [Spice-devel] [PATCH spice-server] Release cursor as soon as possible

2017-09-06 Thread Christophe Fergeau
On Wed, Sep 06, 2017 at 01:41:21PM +0100, Frediano Ziglio wrote: > diff --git a/server/red-parse-qxl.c b/server/red-parse-qxl.c > index 33f36923a..fda4ff26d 100644 > --- a/server/red-parse-qxl.c > +++ b/server/red-parse-qxl.c > @@ -26,6 +26,7 @@ > #include "red-common.h" > #include "memslot.h" >

Re: [Spice-devel] [PATCH spice-server 2/3] red-worker: Avoid changing message numbers used by replay utility

2017-09-06 Thread Christophe Fergeau
On Wed, Sep 06, 2017 at 10:48:40AM -0400, Frediano Ziglio wrote: > > > > On Mon, Sep 04, 2017 at 10:47:45AM -0400, Frediano Ziglio wrote: > > > > > > > > On Fri, Sep 01, 2017 at 10:36:58AM +0100, Frediano Ziglio wrote: > > > > > These constants are saved into record files so their values should n

Re: [Spice-devel] [PATCH spice-server 2/3] red-worker: Avoid changing message numbers used by replay utility

2017-09-06 Thread Frediano Ziglio
> > On Mon, Sep 04, 2017 at 10:47:45AM -0400, Frediano Ziglio wrote: > > > > > > On Fri, Sep 01, 2017 at 10:36:58AM +0100, Frediano Ziglio wrote: > > > > These constants are saved into record files so their values should not > > > > be changed in order to be able to use old record files. > > > >

Re: [Spice-devel] [PATCH spice-server 2/2] Reuse GOBJECT_DECLARE_TYPE* macros

2017-09-06 Thread Frediano Ziglio
> > On Mon, Sep 04, 2017 at 05:09:23PM +0100, Frediano Ziglio wrote: > > Signed-off-by: Frediano Ziglio > > --- > > server/char-device.c | 2 +- > > server/char-device.h | 14 +- > > server/common-graphics-channel.h | 40 ++-- > > server/cursor-channel

[Spice-devel] [PATCH spice-server v2 1/2] Introduce some macros to help declaring new GObject

2017-09-06 Thread Frediano Ziglio
The macros will implement most of the boilerplate needed to declare an object. Their usage are similar to GLib G_DECLARE_*_TYPE macros. Signed-off-by: Frediano Ziglio --- Changes since v1: - use SPICE_ prefix instead of GOBJECT_; - if RED_ prefix is used use this prefix for all GLib macros. ---

[Spice-devel] [PATCH spice-server v2 2/2] Reuse SPICE_DECLARE_TYPE* macros

2017-09-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/char-device.h | 14 +- server/common-graphics-channel.h | 40 ++-- server/cursor-channel-client.h| 18 +-- server/cursor-channel.h | 13 +- server/dcc.h | 18 +-- server/dispatch

[Spice-devel] [PATCH spice-server] Release cursor as soon as possible

2017-09-06 Thread Frediano Ziglio
Cursor resources (basically the shape of it) was retained till it was used however it was copied so there were no reason to not release this resource. Signed-off-by: Frediano Ziglio --- server/cursor-channel.c | 14 -- server/cursor-channel.h | 4 ++-- server/red-par

Re: [Spice-devel] [spice-server 1/3] channel: Call red_channel_disconnect_if_pending_send() from red_channel_wait_all_sent()

2017-09-06 Thread Frediano Ziglio
> > On Mon, Sep 04, 2017 at 10:39:53AM -0400, Frediano Ziglio wrote: > > > > > > On Mon, Sep 04, 2017 at 09:04:03AM -0400, Frediano Ziglio wrote: > > > > > > > > > > On Mon, Sep 04, 2017 at 06:06:57AM -0400, Frediano Ziglio wrote: > > > > > > > > > > > > > > On Fri, Sep 01, 2017 at 06:19:28AM -

Re: [Spice-devel] [PATCH spice-server v2 1/3] Dispatcher: validate received message types

2017-09-06 Thread Frediano Ziglio
> > Although dispatcher_send_message() does not allow you to send a message > type that is invalid for a dispatcher, it still makes sense to verify > that the type is valid in the receiver. This should only be possible in > the case of some severe problem such as memory corruption, so if it is > i

Re: [Spice-devel] [PATCH spice-server v2 2/3] Dispatcher: typedef enum for dispatcher flags

2017-09-06 Thread Frediano Ziglio
> > dispatcher_register_handler() accepts a flag value that determines > whether the message type requires an ACK or async_done handler. This > parameter was previously just an int. It is now a typedef'ed enum: > DispatcherFlag. The enum values were accordingly renamed: > > DISPATCHER_* -> DISP

Re: [Spice-devel] [PATCH spice-server 1/2] Introduce a macro to help declaring new GObject

2017-09-06 Thread Frediano Ziglio
> > How does this relate to G_DECLARE_DERIVABLE_TYPE/G_DECLARE_FINAL_TYPE? > Similar but for any type, kind of declare version for G_DEFINE_TYPE. Why did I choose a GOBJECT_ prefix I don't know... Frediano > On Mon, Sep 04, 2017 at 05:09:22PM +0100, Frediano Ziglio wrote: > > The macro will i

Re: [Spice-devel] [PATCH spice-server 2/3] red-worker: Avoid changing message numbers used by replay utility

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 10:47:45AM -0400, Frediano Ziglio wrote: > > > > On Fri, Sep 01, 2017 at 10:36:58AM +0100, Frediano Ziglio wrote: > > > These constants are saved into record files so their values should not > > > be changed in order to be able to use old record files. > > > Recently 2 diff

Re: [Spice-devel] [PATCH spice-server v2 1/6] red-channel-client: Remove push call where not necessary

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 11:28:45AM -0400, Frediano Ziglio wrote: > > > > On Mon, Sep 04, 2017 at 10:50:44AM -0400, Frediano Ziglio wrote: > > > > > > > > On Mon, Sep 04, 2017 at 12:02:05PM +0100, Frediano Ziglio wrote: > > > > > Now the push is done automatically when a PipeItem is added > > > >

Re: [Spice-devel] [PATCH spice-server v3 6/6] cursor-channel: Use a single RedCursorPipeItem to hold the cursor

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 04:02:58PM +0100, Frediano Ziglio wrote: > > -static CursorItem *cursor_item_new(QXLInstance *qxl, RedCursorCmd *cmd) > +static RedCursorPipeItem *cursor_pipe_item_new(QXLInstance *qxl, > RedCursorCmd *cmd) > { > -CursorItem *cursor_item; > +RedCursorPipeItem *it

Re: [Spice-devel] [PATCH spice-server 2/2] Reuse GOBJECT_DECLARE_TYPE* macros

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 05:09:23PM +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/char-device.c | 2 +- > server/char-device.h | 14 +- > server/common-graphics-channel.h | 40 ++-- > server/cursor-channel-client.h| 18

Re: [Spice-devel] [PATCH spice-server 1/2] Introduce a macro to help declaring new GObject

2017-09-06 Thread Christophe Fergeau
How does this relate to G_DECLARE_DERIVABLE_TYPE/G_DECLARE_FINAL_TYPE? On Mon, Sep 04, 2017 at 05:09:22PM +0100, Frediano Ziglio wrote: > The macro will implement most of the boilerplate needed > to declare an object. > > Signed-off-by: Frediano Ziglio > --- > server/red-common.h | 34 +

Re: [Spice-devel] [PATCH spice-server v3] red-worker: Fix leak processing update commands

2017-09-06 Thread Christophe Fergeau
On Mon, Sep 04, 2017 at 05:28:29PM +0100, Frediano Ziglio wrote: > Is possible to have a leak processing update commands if > the update command is synchronous and the rectangle list > is empty. Note that Qemu always pass an empty list. > > If the list is empty display_channel_update fill the list

Re: [Spice-devel] [PATCH spice-server v2 2/3] Dispatcher: typedef enum for dispatcher flags

2017-09-06 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Tue, Sep 05, 2017 at 01:51:04PM -0500, Jonathon Jongsma wrote: > dispatcher_register_handler() accepts a flag value that determines > whether the message type requires an ACK or async_done handler. This > parameter was previously just an int. It is now a typedef'e

Re: [Spice-devel] [PATCH spice-server v2 3/3] Add documentation for Dispatcher

2017-09-06 Thread Christophe Fergeau
On Tue, Sep 05, 2017 at 01:51:05PM -0500, Jonathon Jongsma wrote: > void dispatcher_register_async_done_callback( > Dispatcher *dispatcher, > dispatcher_handle_async_done handler); > > -/* > - * Hack to allow red_record to

Re: [Spice-devel] [PATCH spice-server v2 3/3] Add documentation for Dispatcher

2017-09-06 Thread Uri Lublin
On 09/05/2017 09:51 PM, Jonathon Jongsma wrote: --- server/dispatcher.h | 140 +++- 1 file changed, 116 insertions(+), 24 deletions(-) diff --git a/server/dispatcher.h b/server/dispatcher.h index 862fc46b9..058032dbb 100644 --- a/server/dispatch

[Spice-devel] [PATCH spice-html5 2/2] main: Add event to alert file transfer error messages

2017-09-06 Thread Tomáš Bohdálek
--- main.js | 15 +++ spice.html | 5 + spice_auto.html | 5 + 3 files changed, 25 insertions(+) diff --git a/main.js b/main.js index 0237f0e..447177b 100644 --- a/main.js +++ b/main.js @@ -385,20 +385,25 @@ SpiceMainConn.prototype.handle_file_xfer_status = fun

[Spice-devel] [PATCH spice-html5 1/2] main: Add messages for file transfer detailed errors

2017-09-06 Thread Tomáš Bohdálek
--- enums.js| 12 ++-- main.js | 16 +++- spicemsg.js | 4 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/enums.js b/enums.js index d5a9003..7154595 100644 --- a/enums.js +++ b/enums.js @@ -369,12 +369,20 @@ var VD_AGENT_CAP_MOUSE_STATE

[Spice-devel] [PATCH spice-html5] cursor: Add support for mono cursor type

2017-09-06 Thread Tomáš Bohdálek
--- cursor.js| 21 +++-- png.js | 2 +- spice.html | 1 + spice_auto.html | 1 + thirdparty/monocursor.js | 79 5 files changed, 94 insertions(+), 10 deletions(-) create mode 10064