Re: [Spice-devel] [PATCH spice-server v2] reds: Check we don't register a channel twice in reds_register_channel

2019-03-20 Thread Snir Sheriber
Ack On 3/19/19 4:11 PM, Frediano Ziglio wrote: To avoid potential regressions, check it only if extra checks are enabled. This allows to check previous "Move channel registration to constructed vfunc" commit. Signed-off-by: Frediano Ziglio --- server/reds.c | 8 1 file changed, 8 i

Re: [Spice-devel] [PATCH spice-server 2/2] Make channel client callbacks virtual functions

2019-03-20 Thread Frediano Ziglio
> > Rather than having an API to register client callbacks for each channel > type, make them vfuncs. > > Since the client callbacks are registered identically for each channel > of the same type, it doesn't make sense for to require these to be > registered separately for each object. It's clea

[Spice-devel] [PATCH spice-server 05/10] main-dispatcher: Use dispatcher_send_message_generic

2019-03-20 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/main-dispatcher.c | 38 -- 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/server/main-dispatcher.c b/server/main-dispatcher.c index 839e7242..904579a8 100644 --- a/server/main-dispatcher.c +++ b/server/m

[Spice-devel] [PATCH spice-server 00/10] RedChannel vfunc follow up

2019-03-20 Thread Frediano Ziglio
Yesterday evening me and Jonathon discussed about his patches for RedChannel vfuncs. We agreed that the function should be vfuncs however the patches didn't seem really great to me so we discussed different reasons. Came out with this series which is working pretty well. Probably I should add so

[Spice-devel] [PATCH spice-server 03/10] main-dispatcher: Remove main_dispatcher_self_handle_channel_event

2019-03-20 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/main-dispatcher.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/server/main-dispatcher.c b/server/main-dispatcher.c index 82b25e6e..0dcfb2d4 100644 --- a/server/main-dispatcher.c +++ b/server/main-dispatcher.c @@ -149,

[Spice-devel] [PATCH spice-server 04/10] main-dispatcher: Use reds as opaque for dispatcher

2019-03-20 Thread Frediano Ziglio
No reason to pass through MainDispatcher, the purpose of MainDispatcher is to call reds functions from the right thread. Signed-off-by: Frediano Ziglio --- server/main-dispatcher.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/server/main-dispatcher.c b/s

[Spice-devel] [PATCH spice-server 02/10] dispatcher: Allows to manage message without registering them

2019-03-20 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/dispatcher.c | 71 ++--- server/dispatcher.h | 15 ++ 2 files changed, 62 insertions(+), 24 deletions(-) diff --git a/server/dispatcher.c b/server/dispatcher.c index 5f839ec4..0b18b32d 100644 --- a/server/d

[Spice-devel] [PATCH spice-server 08/10] Move DisplayChannel callbacks from RedWorker to DisplayChannel

2019-03-20 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/display-channel.c | 104 +++ server/display-channel.h | 5 ++ server/red-worker.c | 113 ++- 3 files changed, 112 insertions(+), 110 deletions(-) diff --git a/server/display-chann

[Spice-devel] [PATCH spice-server 06/10] Move thread/dispatching handling to RedChannel

2019-03-20 Thread Frediano Ziglio
Currently channel threading/handling is spread between RedQxl, RedWorker and RedChannel. Move more to RedChannel simplify RedQxl and RedWorker. Signed-off-by: Frediano Ziglio --- server/cursor-channel.c| 4 +- server/cursor-channel.h| 4 +- server/display-channel.c | 2 + server/

[Spice-devel] [PATCH spice-server 01/10] dispatcher: Use NULL for pointer check

2019-03-20 Thread Frediano Ziglio
handler is a pointer, check for NULL, not 0. Signed-off-by: Frediano Ziglio --- server/dispatcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/dispatcher.c b/server/dispatcher.c index ce487f63..5f839ec4 100644 --- a/server/dispatcher.c +++ b/server/dispatcher.c @@

[Spice-devel] [PATCH spice-server 07/10] Propagate running property from RedWorker to DisplayChannel

2019-03-20 Thread Frediano Ziglio
This is a preparatory patch to allows DisplayChannel to check if device is running. Signed-off-by: Frediano Ziglio --- server/display-channel-private.h | 1 + server/display-channel.c | 8 server/display-channel.h | 2 ++ server/red-worker.c | 2 ++ 4 files

[Spice-devel] [PATCH spice-server 09/10] Make channel client callbacks virtual functions

2019-03-20 Thread Frediano Ziglio
From: Jonathon Jongsma Rather than having an API to register client callbacks for each channel type, make them vfuncs. Since the client callbacks are registered identically for each channel of the same type, it doesn't make sense for to require these to be registered separately for each object.

[Spice-devel] [PATCH spice-server 10/10] Make some function static

2019-03-20 Thread Frediano Ziglio
Now that stuff are a bit more on their correct place some function can be static. Signed-off-by: Frediano Ziglio --- server/cursor-channel.c | 11 --- server/cursor-channel.h | 10 -- server/display-channel.c | 12 +--- server/display-channel.h | 5 - 4 files chang

[Spice-devel] [PATCH spice-server 2/2] red-worker: Avoid possible string formatting warning

2019-03-20 Thread Frediano Ziglio
Although id is not supposed to be big prevent possible warning/overflow. Signed-off-by: Frediano Ziglio --- server/red-worker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) This was signaled by Christophe Fergeau diff --git a/server/red-worker.c b/server/red-worker.c index 8051d1e4..a

[Spice-devel] [PATCH spice-server 1/2] red-worker: Use mnemonic for statistic buffer

2019-03-20 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- I was wondering where that "20" came. --- server/red-worker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/red-worker.c b/server/red-worker.c index 3cb12b9c..8051d1e4 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -

Re: [Spice-devel] [PATCH spice-server 2/2] red-worker: Avoid possible string formatting warning

2019-03-20 Thread Christophe Fergeau
On Wed, Mar 20, 2019 at 02:51:29PM +, Frediano Ziglio wrote: > Although id is not supposed to be big prevent possible > warning/overflow. > > Signed-off-by: Frediano Ziglio > --- > server/red-worker.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > This was signaled by Christoph

Re: [Spice-devel] [PATCH spice-server 2/2] red-worker: Avoid possible string formatting warning

2019-03-20 Thread Frediano Ziglio
> > On Wed, Mar 20, 2019 at 02:51:29PM +, Frediano Ziglio wrote: > > Although id is not supposed to be big prevent possible > > warning/overflow. > > > > Signed-off-by: Frediano Ziglio > > --- > > server/red-worker.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > This wa

Re: [Spice-devel] [PATCH spice-server 2/2] red-worker: Avoid possible string formatting warning

2019-03-20 Thread Christophe Fergeau
On Wed, Mar 20, 2019 at 11:20:20AM -0400, Frediano Ziglio wrote: > > > > On Wed, Mar 20, 2019 at 02:51:29PM +, Frediano Ziglio wrote: > > > Although id is not supposed to be big prevent possible > > > warning/overflow. > > > > > > Signed-off-by: Frediano Ziglio > > > --- > > > server/red-wo

Re: [Spice-devel] [PATCH spice-server 01/10] dispatcher: Use NULL for pointer check

2019-03-20 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > handler is a pointer, check for NULL, not 0. > > Signed-off-by: Frediano Ziglio > --- > server/dispatcher.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/server/dispatcher.c b/se

[Spice-devel] [PATCH spice-server v2 1/2] red-worker: Use mnemonic for statistic buffer

2019-03-20 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- I was wondering where that "20" came. --- server/red-worker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/red-worker.c b/server/red-worker.c index 3cb12b9c..8051d1e4 100644 --- a/server/red-worker.c +++ b/server/red-worker.c @@ -

[Spice-devel] [PATCH spice-server v2 2/2] worker: Fix potential sprintf overflow

2019-03-20 Thread Frediano Ziglio
From: Christophe Fergeau If worker->qxl->id is bigger than 0x7ff (in other words, it's a negative signed int) then printf(worker_str, "display[%d]", worker->qxl->id); will need: "display[]" -> 9 bytes %d -> 11 bytes The trailing \0 will thus overflow our 20 bytes destination. As QXLInstance

[Spice-devel] [PATCH spice-streaming-agent] Add support log logging statistics from plugins

2019-03-20 Thread Frediano Ziglio
Allows the plugins to add information to the log. Signed-off-by: Frediano Ziglio --- Not entirely happy to export a kind of C function, any suggestion welcome --- include/spice-streaming-agent/plugin.hpp | 5 + src/concrete-agent.cpp | 16 ++-- src/concrete-age

Re: [Spice-devel] [PATCH spice-server 02/10] dispatcher: Allows to manage message without registering them

2019-03-20 Thread Jonathon Jongsma
On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/dispatcher.c | 71 ++- > -- > server/dispatcher.h | 15 ++ > 2 files changed, 62 insertions(+), 24 deletions(-) > > diff --git a/server/dispat

Re: [Spice-devel] [PATCH spice-server 03/10] main-dispatcher: Remove main_dispatcher_self_handle_channel_event

2019-03-20 Thread Jonathon Jongsma
That's a weird function, but seems rather unrelated to the current series. Acked-by: Jonathon Jongsma On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/main-dispatcher.c | 13 ++--- > 1 file changed, 2 insertions(+), 11 deletions

Re: [Spice-devel] [PATCH spice-server 04/10] main-dispatcher: Use reds as opaque for dispatcher

2019-03-20 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > No reason to pass through MainDispatcher, the purpose of > MainDispatcher is to call reds functions from the right thread. > > Signed-off-by: Frediano Ziglio > --- > server/main-dispatcher.c | 18 +-

Re: [Spice-devel] [PATCH spice-server 02/10] dispatcher: Allows to manage message without registering them

2019-03-20 Thread Frediano Ziglio
> > On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > > Signed-off-by: Frediano Ziglio > > --- > > server/dispatcher.c | 71 ++- > > -- > > server/dispatcher.h | 15 ++ > > 2 files changed, 62 insertions(+), 24 deletions(-) > > > > diff

Re: [Spice-devel] [PATCH spice-server 05/10] main-dispatcher: Use dispatcher_send_message_generic

2019-03-20 Thread Jonathon Jongsma
There should be some justification in the commit log about why this is an improvement. Jonathon On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > server/main-dispatcher.c | 38 -- > 1 file changed, 8 insertion

Re: [Spice-devel] [PATCH spice-server 03/10] main-dispatcher: Remove main_dispatcher_self_handle_channel_event

2019-03-20 Thread Frediano Ziglio
> > That's a weird function, but seems rather unrelated to the current > series. > Agreed, was on the "dispatcher" line of change. Maybe the title should be "main-dispatcher: Inline main_dispatcher_self_handle_channel_event" (Inline instead of Remove) ? > Acked-by: Jonathon Jongsma > > > O

Re: [Spice-devel] [PATCH spice-server 06/10] Move thread/dispatching handling to RedChannel

2019-03-20 Thread Jonathon Jongsma
On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > Currently channel threading/handling is spread between RedQxl, > RedWorker and RedChannel. > Move more to RedChannel simplify RedQxl and RedWorker. > > Signed-off-by: Frediano Ziglio > --- > server/cursor-channel.c| 4 +- > server

Re: [Spice-devel] [PATCH spice-server 07/10] Propagate running property from RedWorker to DisplayChannel

2019-03-20 Thread Jonathon Jongsma
Somehow this information doesn't really seem to belong to DisplayChannel, but I can't put my finger on exactly why it feels out of place... On Wed, 2019-03-20 at 09:59 +, Frediano Ziglio wrote: > This is a preparatory patch to allows DisplayChannel to check > if device is running. > > Signe