Re: [Spice-devel] [RFC PATCH spice-server v4 19/22] cursor-channel: Allow to not handle a QXL device

2017-08-25 Thread Jonathon Jongsma
On Fri, 2017-08-25 at 10:54 +0100, Frediano Ziglio wrote: > QXL device requires a QXL interface which imply all set > of requirements like memory sharing. > Currently RedCursorChannel uses QXL to release resources > allocated from such devices. > However this is quite a limitation as potentially we

Re: [Spice-devel] [RFC PATCH spice-server v4 18/22] stream-channel: Activate streaming report from client

2017-08-25 Thread Jonathon Jongsma
ok Acked-by: Jonathon Jongsma On Fri, 2017-08-25 at 10:54 +0100, Frediano Ziglio wrote: > Setting the capability is not enough, each stream must be enabled > so do so if client support them. > > Signed-off-by: Frediano Ziglio > --- > server/stream-channel.c | 19 +++ > 1 file

Re: [Spice-devel] [RFC PATCH spice-server v4 17/22] stream-device: Limit sending queue from guest to server

2017-08-25 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Fri, 2017-08-25 at 10:54 +0100, Frediano Ziglio wrote: > Do not allow the guest to fill host memory. > Also having a huge queue mainly cause to have a higher video > latency. > > Signed-off-by: Frediano Ziglio > --- > server/stream-channel.c | 41 > ++

Re: [Spice-devel] [RFC PATCH spice-server v4 16/22] stream-device: Create channel when needed

2017-08-25 Thread Jonathon Jongsma
I guess this depends on patch 2 ("notify client... dynamically"), so my concerns there will potentially affect this patch. on additional thought below. On Fri, 2017-08-25 at 10:54 +0100, Frediano Ziglio wrote: > This allows a better id allocation as devices are created after > fixed ones. > Also

Re: [Spice-devel] [RFC PATCH spice-server v4 15/22] stream-device: Start supporting resetting device when close/open on guest

2017-08-25 Thread Jonathon Jongsma
On Fri, 2017-08-25 at 10:54 +0100, Frediano Ziglio wrote: > When guest close the device the host device has to be reset too. > This make easier to restart the guest device which can happen in case > of reboot, agent issues or if we want to update the agent. > > Signed-off-by: Frediano Ziglio > --

Re: [Spice-devel] [RFC PATCH spice-server v4 14/22] char-device: Do not stop and clear interface on reset

2017-08-25 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Fri, 2017-08-25 at 10:54 +0100, Frediano Ziglio wrote: > Currently, red_char_device_reset() stops the device, clears all > pending > messages, and clears its device instance. After this function is > called, > the char device will not work again until it is assigned

Re: [Spice-devel] [RFC PATCH spice-server v4 09/22] stream-device: Handle streaming data from device to channel

2017-08-25 Thread Jonathon Jongsma
On Fri, 2017-08-25 at 10:53 +0100, Frediano Ziglio wrote: > Handle stream data from device sending to the channel. > The StreamChannel will forward the data to the clients using standard > DisplayChannel messages, and will create and destroy streams as > necessary. > > Signed-off-by: Frediano Zigl

Re: [Spice-devel] [RFC PATCH spice-server v4 07/22] stream-device: Create channel for stream device

2017-08-25 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Fri, 2017-08-25 at 10:53 +0100, Frediano Ziglio wrote: > So can be used by the device to communicate with the clients. > > Signed-off-by: Frediano Ziglio > --- > server/stream-device.c | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/serv

Re: [Spice-devel] [RFC PATCH spice-server v4 05/22] stream-channel: Write a really base channel to implement the streaming

2017-08-25 Thread Jonathon Jongsma
I don't think the word "really" is necessary in the summary ("really base"). The changes (passing ID to stream_channel_new(), registering channel in constructor, etc) are an improvement Acked-by: Jonathon Jongsma On Fri, 2017-08-25 at 10:53 +0100, Frediano Ziglio wrote: > Currently only compile

Re: [Spice-devel] [RFC PATCH spice-server v4 04/22] stream-device: Start parsing new protocol from guest

2017-08-25 Thread Jonathon Jongsma
On Fri, 2017-08-25 at 10:53 +0100, Frediano Ziglio wrote: > Parse the data sent from the guest to the streaming device. For completeness perhaps add "At the moment, the data is simply discarded after it is parsed." > > Signed-off-by: Frediano Ziglio > --- > server/stream-device.c | 115 > +

[Spice-devel] Some notes on threading and reference counting on spice-server

2017-08-25 Thread Frediano Ziglio
How Spice handle threading -- Lot of code run in a single thread. Qemu usually calls Spice from the same thread except on call backs to code already run in different threads. Channel run mostly on a single thread except on creation and destroying which MUST be done in the

Re: [Spice-devel] [RFC PATCH spice-server v4 02/22] Notify client of the creation of new channels dynamically

2017-08-25 Thread Jonathon Jongsma
On Fri, 2017-08-25 at 10:53 +0100, Frediano Ziglio wrote: > This allows to add channels after the client is connected. "allows to add" -> "allows the server to add" > > Signed-off-by: Frediano Ziglio > --- > server/main-channel-client.c | 50 > > se

Re: [Spice-devel] [RFC PATCH spice-server v3 10/20] stream-channel: Allows to register callback to get new stream request

2017-08-25 Thread Frediano Ziglio
> > On Fri, 2017-08-25 at 05:39 -0400, Frediano Ziglio wrote: > > > > > > I had a similar comment in a different patch during the last > > > version of > > > the series, but I personally would prefer a signal to handle this > > > situation. For example, StreamChannel could have a "supported- > >

Re: [Spice-devel] [PATCH spice-server 5/5] red-client: Prevent some nasty threading problems disconnecting channels

2017-08-25 Thread Christophe Fergeau
On Thu, Aug 24, 2017 at 03:37:20PM +0100, Frediano Ziglio wrote: > The channels list was not protected by a lock in red_client_destroy. > This could cause for instance a RedChannelClient object to be > created while scanning the list so potentially modifying the > list while scanning with all race

Re: [Spice-devel] [RFC PATCH spice-server v4 01/22] Avoid to use global variable for channel IDs

2017-08-25 Thread Frediano Ziglio
> > shortlog: "Avoid to" is not really grammatically correct. It should be > something like "Avoid using" or "Don't use" > > On Fri, 2017-08-25 at 10:53 +0100, Frediano Ziglio wrote: > > This patch allocate VMC IDs finding the first ID not used > > "allocates" > "by finding" > > > instead of us

Re: [Spice-devel] [PATCH spice-server v2] gstreamer: Check if ORC library can work

2017-08-25 Thread Christophe Fergeau
On Fri, Aug 25, 2017 at 11:30:29AM -0400, Frediano Ziglio wrote: > > > > On Fri, Aug 25, 2017 at 10:33:28AM -0400, Frediano Ziglio wrote: > > > > > > > > On Fri, Aug 18, 2017 at 12:32:12PM +0100, Frediano Ziglio wrote: > > > > > ORC lirabry is used internally by GStreamer to generate code > > > >

Re: [Spice-devel] [PATCH spice-server 3/5] red-qxl: Avoid using dandling pointers to RedClient

2017-08-25 Thread Christophe Fergeau
On Thu, Aug 24, 2017 at 03:37:18PM +0100, Frediano Ziglio wrote: > A RedClient can be freed from the main thread following > a main channel disconnection. I'd mention reds_client_disconnect or some concrete function name so that someone wanting to follow that code has something to start from. > T

Re: [Spice-devel] [PATCH spice-server v2] gstreamer: Check if ORC library can work

2017-08-25 Thread Frediano Ziglio
> > On Fri, Aug 25, 2017 at 10:33:28AM -0400, Frediano Ziglio wrote: > > > > > > On Fri, Aug 18, 2017 at 12:32:12PM +0100, Frediano Ziglio wrote: > > > > ORC lirabry is used internally by GStreamer to generate code > > > > dynamically. > > > > > > "The ORC library" > > > > > > > If ORC cannot a

Re: [Spice-devel] [RFC PATCH spice-server v4 01/22] Avoid to use global variable for channel IDs

2017-08-25 Thread Jonathon Jongsma
shortlog: "Avoid to" is not really grammatically correct. It should be something like "Avoid using" or "Don't use" On Fri, 2017-08-25 at 10:53 +0100, Frediano Ziglio wrote: > This patch allocate VMC IDs finding the first ID not used "allocates" "by finding" > instead of using a global variable a

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

2017-08-25 Thread Christophe Fergeau
On Fri, Aug 25, 2017 at 11:04:35AM -0400, Frediano Ziglio wrote: > > > > On Thu, Aug 24, 2017 at 03:37:16PM +0100, Frediano Ziglio wrote: > > > You could easily trigger this issue using multiple monitors and > > > a modified client with this patch: > > > > > > --- a/src/channel-main.c > > > +++ b

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

2017-08-25 Thread Frediano Ziglio
> > On Thu, Aug 24, 2017 at 03:37:16PM +0100, Frediano Ziglio wrote: > > You could easily trigger this issue using multiple monitors and > > a modified client with this patch: > > > > --- a/src/channel-main.c > > +++ b/src/channel-main.c > > @@ -1699,6 +1699,7 @@ static gboolean _channel_new(chan

Re: [Spice-devel] [PATCH spice-server v2] gstreamer: Check if ORC library can work

2017-08-25 Thread Christophe Fergeau
On Fri, Aug 25, 2017 at 10:33:28AM -0400, Frediano Ziglio wrote: > > > > On Fri, Aug 18, 2017 at 12:32:12PM +0100, Frediano Ziglio wrote: > > > ORC lirabry is used internally by GStreamer to generate code > > > dynamically. > > > > "The ORC library" > > > > > If ORC cannot allocate executable me

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

2017-08-25 Thread Christophe Fergeau
On Thu, Aug 24, 2017 at 03:37:16PM +0100, Frediano Ziglio wrote: > You could easily trigger this issue using multiple monitors and > a modified 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 3/3] red-channel: Allows to retrieve client callback saves pointer

2017-08-25 Thread Frediano Ziglio
> > On Fri, Aug 25, 2017 at 11:24:41AM +0100, Frediano Ziglio wrote: > > The data pointer for client callbacks was not used. > > The code was saving this information using callback registration > > and g_object_set_data. Remove the g_object_set_data using > > the data registered. > > Ah, hmm, I a

Re: [Spice-devel] [PATCH spice-server v2] gstreamer: Check if ORC library can work

2017-08-25 Thread Frediano Ziglio
> > > > > On Fri, Aug 18, 2017 at 12:32:12PM +0100, Frediano Ziglio wrote: > > > ORC lirabry is used internally by GStreamer to generate code > > > dynamically. > > > > "The ORC library" > > > > > If ORC cannot allocate executable memory the failure cause > > > an abort(3) to be called. > > >

Re: [Spice-devel] [PATCH spice-server v2] gstreamer: Check if ORC library can work

2017-08-25 Thread Frediano Ziglio
> > On Fri, Aug 18, 2017 at 12:32:12PM +0100, Frediano Ziglio wrote: > > ORC lirabry is used internally by GStreamer to generate code > > dynamically. > > "The ORC library" > > > If ORC cannot allocate executable memory the failure cause > > an abort(3) to be called. > > "memory, the failure ca

[Spice-devel] [PATCH spice-server v2] red-channel: Store client callbacks in ClientCbs

2017-08-25 Thread Frediano Ziglio
Instead of using a separate parameter and field store in the same structure. This allows to pass the pointer while passing callbacks and also make easier to understand that "data" field is related to callbacks. Also allows to retrieve client callback saved pointer. The data pointer for client callb

Re: [Spice-devel] [PATCH spice-server v2] gstreamer: Check if ORC library can work

2017-08-25 Thread Christophe Fergeau
On Fri, Aug 18, 2017 at 12:32:12PM +0100, Frediano Ziglio wrote: > ORC lirabry is used internally by GStreamer to generate code > dynamically. "The ORC library" > If ORC cannot allocate executable memory the failure cause > an abort(3) to be called. "memory, the failure causes" > This happens o

Re: [Spice-devel] [RFC PATCH spice-server v3 10/20] stream-channel: Allows to register callback to get new stream request

2017-08-25 Thread Jonathon Jongsma
On Fri, 2017-08-25 at 05:39 -0400, Frediano Ziglio wrote: > > > > I had a similar comment in a different patch during the last > > version of > > the series, but I personally would prefer a signal to handle this > > situation. For example, StreamChannel could have a "supported- > > codecs" > > pro

Re: [Spice-devel] [PATCH spice-server 4/5] red-client: Protect disconnecting with a lock

2017-08-25 Thread Christophe Fergeau
On Thu, Aug 24, 2017 at 03:37:19PM +0100, Frediano Ziglio wrote: > Allows to access it safely from different threads. I guess it would be worth mentioning the code paths where it's needed in the commit log. Christophe > > Signed-off-by: Frediano Ziglio > --- > server/red-client.c | 8 +++-

Re: [Spice-devel] [PATCH spice-server 2/5] red-worker: Remove small memory leak

2017-08-25 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Thu, Aug 24, 2017 at 03:37:17PM +0100, Frediano Ziglio wrote: > If a DisplayChannelClient cannot be instantiated capabilities > are not released correctly. > > Signed-off-by: Frediano Ziglio > --- > server/red-worker.c | 3 +-- > 1 file changed, 1 insertion(+),

[Spice-devel] [PATCH spice-server] worker: Add some loop statistics

2017-08-25 Thread Frediano Ziglio
Trace the number of loops done processing display commands and the number of loops in which the queue was full. Signed-off-by: Frediano Ziglio --- This patch came from quite ancien time when we were debugging the loop to understand some issues due to GLib integration. Was marked as "statistics fr

Re: [Spice-devel] [PATCH spice-server 2/3] sound: Do not pass unused pointer

2017-08-25 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Fri, Aug 25, 2017 at 11:24:40AM +0100, Frediano Ziglio wrote: > Client callbacks in sound channels do not use registered > data so don't pass a valid pointer making clear from > source that the parameter is not used. > > Signed-off-by: Frediano Ziglio > --- > s

Re: [Spice-devel] [PATCH spice-server 3/3] red-channel: Allows to retrieve client callback saves pointer

2017-08-25 Thread Christophe Fergeau
On Fri, Aug 25, 2017 at 11:24:41AM +0100, Frediano Ziglio wrote: > The data pointer for client callbacks was not used. > The code was saving this information using callback registration > and g_object_set_data. Remove the g_object_set_data using > the data registered. Ah, hmm, I actually had diffe

Re: [Spice-devel] [PATCH spice-server 1/3] red-qxl: Remove redundant checks

2017-08-25 Thread Christophe Fergeau
On Fri, Aug 25, 2017 at 11:24:39AM +0100, Frediano Ziglio wrote: > A RedChannelClient is always attached to a valid RedChannel. Yup, RedChannelClient::channel is construct-only, and RedChannelClient::constructed already assumes that it has a non-NULL channel. Acked-by: Christophe Fergeau > > S

Re: [Spice-devel] [spice-server v2] RedChannelClient: Mark some private data as bool

2017-08-25 Thread Christophe Fergeau
On Fri, Aug 25, 2017 at 07:37:05AM -0400, Frediano Ziglio wrote: > > > > I would propagate the types, something like this: > > > > https://cgit.freedesktop.org/~fziglio/spice-server/commit/?h=teuf2&id=6930f008fd0dcbffc9e0c7a47e49dcdd1013b1e1 > > > > Beside that, > > > > Acked-by: Frediano Zigli

Re: [Spice-devel] [PATCH spice-server] Avoid to access data before a NULL check

2017-08-25 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Fri, Aug 25, 2017 at 01:44:00PM +0100, Frediano Ziglio wrote: > If you are testing for NULL data this means that variable could be > NULL so avoid to access before the check to make sure the check is hit. > > Signed-off-by: Frediano Ziglio > --- > server/cursor-

Re: [Spice-devel] [PATCH spice-server] dcc: Reuse display variable

2017-08-25 Thread Christophe Fergeau
Sure, Acked-by: Christophe Fergeau On Fri, Aug 25, 2017 at 01:36:51PM +0100, Frediano Ziglio wrote: > display variable already contains the DCC_TO_DC(dcc) value so > reuse it. > > Signed-off-by: Frediano Ziglio > --- > server/dcc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >

[Spice-devel] [PATCH spice-server] Avoid to access data before a NULL check

2017-08-25 Thread Frediano Ziglio
If you are testing for NULL data this means that variable could be NULL so avoid to access before the check to make sure the check is hit. Signed-off-by: Frediano Ziglio --- server/cursor-channel.c | 3 ++- server/dcc-send.c | 11 --- server/stream.c | 3 ++- 3 files chan

[Spice-devel] [PATCH spice-server] dcc: Reuse display variable

2017-08-25 Thread Frediano Ziglio
display variable already contains the DCC_TO_DC(dcc) value so reuse it. Signed-off-by: Frediano Ziglio --- server/dcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/dcc.c b/server/dcc.c index 4490507b..2778bb88 100644 --- a/server/dcc.c +++ b/server/dcc.c @@ -297,7

Re: [Spice-devel] [PATCH spice-server] display-channel: Check that all structure are destroyed during finalize

2017-08-25 Thread Frediano Ziglio
> > On Thu, Aug 24, 2017 at 05:11:34AM -0400, Frediano Ziglio wrote: > > > > > > On Tue, 2017-08-22 at 08:54 +0100, Frediano Ziglio wrote: > > > > The leak detector we use currently is not enough to detect > > > > some kind of leak in DisplayChannel so manully test. > > > > These tests are enable

Re: [Spice-devel] [PATCH spice-server] display-channel: Check that all structure are destroyed during finalize

2017-08-25 Thread Christophe Fergeau
On Thu, Aug 24, 2017 at 05:11:34AM -0400, Frediano Ziglio wrote: > > > > On Tue, 2017-08-22 at 08:54 +0100, Frediano Ziglio wrote: > > > The leak detector we use currently is not enough to detect > > > some kind of leak in DisplayChannel so manully test. > > > These tests are enabled only when --e

Re: [Spice-devel] [PATCH spice-server] reds: Inline very simple function

2017-08-25 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Fri, Aug 25, 2017 at 09:46:24AM +0100, Frediano Ziglio wrote: > reds_get_n_clients is a single line and is used only by > spice_server_get_num_clients. > The 2 functions have very similar names so inlining > reds_get_n_clients does not make code less readable. >

Re: [Spice-devel] [spice-server v2] RedChannelClient: Mark some private data as bool

2017-08-25 Thread Frediano Ziglio
> > I would propagate the types, something like this: > > https://cgit.freedesktop.org/~fziglio/spice-server/commit/?h=teuf2&id=6930f008fd0dcbffc9e0c7a47e49dcdd1013b1e1 > > Beside that, > > Acked-by: Frediano Ziglio > Updated version of proposed fixup at https://cgit.freedesktop.org/~fziglio

[Spice-devel] [PATCH spice-server 2/3] sound: Do not pass unused pointer

2017-08-25 Thread Frediano Ziglio
Client callbacks in sound channels do not use registered data so don't pass a valid pointer making clear from source that the parameter is not used. Signed-off-by: Frediano Ziglio --- server/sound.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sound.c b/server/s

[Spice-devel] [PATCH spice-server 3/3] red-channel: Allows to retrieve client callback saves pointer

2017-08-25 Thread Frediano Ziglio
The data pointer for client callbacks was not used. The code was saving this information using callback registration and g_object_set_data. Remove the g_object_set_data using the data registered. Signed-off-by: Frediano Ziglio --- server/red-channel.c | 5 + server/red-channel.h | 2 ++ se

[Spice-devel] [PATCH spice-server 1/3] red-qxl: Remove redundant checks

2017-08-25 Thread Frediano Ziglio
A RedChannelClient is always attached to a valid RedChannel. Signed-off-by: Frediano Ziglio --- server/red-qxl.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/server/red-qxl.c b/server/red-qxl.c index 53f3338b..ba869e54 100644 --- a/server/red-qxl.c +++ b/server/red-qxl.c @@

[Spice-devel] [RFC PATCH spice-server v4 17/22] stream-device: Limit sending queue from guest to server

2017-08-25 Thread Frediano Ziglio
Do not allow the guest to fill host memory. Also having a huge queue mainly cause to have a higher video latency. Signed-off-by: Frediano Ziglio --- server/stream-channel.c | 41 - server/stream-channel.h | 10 ++ server/stream-device.c | 35 +

[Spice-devel] [RFC PATCH spice-server v4 21/22] WIP: Try to reduce delay

2017-08-25 Thread Frediano Ziglio
This is an hacky patch that tryes to reduce lag --- server/stream-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/stream-device.c b/server/stream-device.c index 5ab41396..88e5abba 100644 --- a/server/stream-device.c +++ b/server/stream-device.c @@ -182,7 +182,7

[Spice-devel] [RFC PATCH spice-server v4 18/22] stream-channel: Activate streaming report from client

2017-08-25 Thread Frediano Ziglio
Setting the capability is not enough, each stream must be enabled so do so if client support them. Signed-off-by: Frediano Ziglio --- server/stream-channel.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/server/stream-channel.c b/server/stream-channel.c index 34c8a351.

[Spice-devel] [RFC PATCH spice-server v4 15/22] stream-device: Start supporting resetting device when close/open on guest

2017-08-25 Thread Frediano Ziglio
When guest close the device the host device has to be reset too. This make easier to restart the guest device which can happen in case of reboot, agent issues or if we want to update the agent. Signed-off-by: Frediano Ziglio --- server/stream-channel.c | 30 ++ server

[Spice-devel] [RFC PATCH spice-server v4 12/22] stream-channel: Support client connection/disconnection

2017-08-25 Thread Frediano Ziglio
When a new client is connected we must restart the stream so new clients can receive correct data without having to wait for the next full screen (which on idle screen could take ages). On disconnection we should tell the guest to stop streaming not wasting resources to stream not needed data. Sig

[Spice-devel] [RFC PATCH spice-server v4 16/22] stream-device: Create channel when needed

2017-08-25 Thread Frediano Ziglio
This allows a better id allocation as devices are created after fixed ones. Also will allow to support more easily multiple monitor. Signed-off-by: Frediano Ziglio --- server/stream-device.c | 32 ++-- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/ser

[Spice-devel] [RFC PATCH spice-server v4 19/22] cursor-channel: Allow to not handle a QXL device

2017-08-25 Thread Frediano Ziglio
QXL device requires a QXL interface which imply all set of requirements like memory sharing. Currently RedCursorChannel uses QXL to release resources allocated from such devices. However this is quite a limitation as potentially we can implement cursors in a virtual device or in a different one. Th

[Spice-devel] [RFC PATCH spice-server v4 11/22] stream-channel: Allows to register callback to get new stream request

2017-08-25 Thread Frediano Ziglio
The channel needs to communicate when it receive a new stream request from the guest. Signed-off-by: Frediano Ziglio --- server/stream-channel.c | 12 server/stream-channel.h | 6 ++ 2 files changed, 18 insertions(+) diff --git a/server/stream-channel.c b/server/stream-channel

[Spice-devel] [RFC PATCH spice-server v4 08/22] stream-channel: Initialize blank display on client connection

2017-08-25 Thread Frediano Ziglio
Send proper messages to client to see the display. Currently a blank display will be showed to the clients connecting. Signed-off-by: Frediano Ziglio Acked-by: Jonathon Jongsma --- server/stream-channel.c | 52 +++-- 1 file changed, 50 insertions(+),

[Spice-devel] [RFC PATCH spice-server v4 20/22] WIP stream-device: handle cursor from device

2017-08-25 Thread Frediano Ziglio
TODO: reuse message code buffering code to handle msg_buf can be reused by different messages we should limit msg_buf base on type of messages Signed-off-by: Frediano Ziglio --- server/stream-device.c | 142 - 1 file changed, 141 insert

[Spice-devel] [RFC PATCH spice-server v4 05/22] stream-channel: Write a really base channel to implement the streaming

2017-08-25 Thread Frediano Ziglio
Currently only compile, not used and not much sense Signed-off-by: Frediano Ziglio Acked-by: Jonathon Jongsma --- server/Makefile.am | 2 + server/stream-channel.c | 171 server/stream-channel.h | 53 +++ 3 files changed, 226

[Spice-devel] [RFC PATCH spice-server v4 07/22] stream-device: Create channel for stream device

2017-08-25 Thread Frediano Ziglio
So can be used by the device to communicate with the clients. Signed-off-by: Frediano Ziglio --- server/stream-device.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/server/stream-device.c b/server/stream-device.c index e343f1f5..0551e5b5 100644 --- a/server/stream-device.c

[Spice-devel] [RFC PATCH spice-server v4 01/22] Avoid to use global variable for channel IDs

2017-08-25 Thread Frediano Ziglio
This patch allocate VMC IDs finding the first ID not used instead of using a global variable and incrementing the value for each channel created. This solve some potential issues: - remove the global state potentially making possible to use multiple SpiceServer on the same process; - avoid to pot

[Spice-devel] [RFC PATCH spice-server v4 22/22] stream-device: Implement mouse movement

2017-08-25 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/stream-device.c | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/server/stream-device.c b/server/stream-device.c index 88e5abba..3d33ca13 100644 --- a/server/stream-device.c +++ b/server/stream-device

[Spice-devel] [RFC PATCH spice-server v4 13/22] stream-channel: Do not show an empty blank screen on start

2017-08-25 Thread Frediano Ziglio
Start showing something when we have a surface and stream instead of showing a blank screen which is now not useful. Was useful for debugging purposes to understand that the new channel was sending messages correctly to client and client could handle them. Signed-off-by: Frediano Ziglio Acked-by:

[Spice-devel] [RFC PATCH spice-server v4 02/22] Notify client of the creation of new channels dynamically

2017-08-25 Thread Frediano Ziglio
This allows to add channels after the client is connected. Signed-off-by: Frediano Ziglio --- server/main-channel-client.c | 50 server/main-channel-client.h | 3 +++ server/main-channel.c| 6 ++ server/main-channel.h| 3 +++ se

[Spice-devel] [RFC PATCH spice-server v4 14/22] char-device: Do not stop and clear interface on reset

2017-08-25 Thread Frediano Ziglio
Currently, red_char_device_reset() stops the device, clears all pending messages, and clears its device instance. After this function is called, the char device will not work again until it is assigned a new device instance and restarted. This is fine for the vdagent char device, which is currently

[Spice-devel] [RFC PATCH spice-server v4 10/22] stream-channel: Allows not fixed size

2017-08-25 Thread Frediano Ziglio
Remove the fixed size stream and support any display size. Signed-off-by: Frediano Ziglio Acked-by: Jonathon Jongsma --- server/stream-channel.c | 31 +-- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/server/stream-channel.c b/server/stream-channel.c

[Spice-devel] [RFC PATCH spice-server v4 06/22] stream-channel: Start implementing DisplayChannel properly

2017-08-25 Thread Frediano Ziglio
Handle messages from clients. Send some messages to clients. Signed-off-by: Frediano Ziglio Acked-by: Jonathon Jongsma --- server/stream-channel.c | 41 - 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/server/stream-channel.c b/server/strea

[Spice-devel] [RFC PATCH spice-server v4 04/22] stream-device: Start parsing new protocol from guest

2017-08-25 Thread Frediano Ziglio
Parse the data sent from the guest to the streaming device. Signed-off-by: Frediano Ziglio --- server/stream-device.c | 115 ++--- 1 file changed, 110 insertions(+), 5 deletions(-) diff --git a/server/stream-device.c b/server/stream-device.c index f3a

[Spice-devel] [RFC PATCH spice-server v4 09/22] stream-device: Handle streaming data from device to channel

2017-08-25 Thread Frediano Ziglio
Handle stream data from device sending to the channel. The StreamChannel will forward the data to the clients using standard DisplayChannel messages, and will create and destroy streams as necessary. Signed-off-by: Frediano Ziglio --- server/stream-channel.c | 111 +++

[Spice-devel] [RFC PATCH spice-server v4 03/22] stream-device: Add device to handle streaming

2017-08-25 Thread Frediano Ziglio
Add a stub device in guest. The aim of this device is to make it possible for the guest to send a stream through a DisplayChannel (in the sense of protocol channel). This stub allows the guest to send some data and you can see some debug lines of data arrived on host logs. Signed-off-by: Frediano

[Spice-devel] [RFC PATCH spice-server v4 00/22] Allows guests to send display data as video streams

2017-08-25 Thread Frediano Ziglio
This patcheset add a device to allow guest machines with assigned hardware devices to send encoded video and other informations that will be handled as a normal display by Spice. New GPU devices are capable to capture and encode video in an efficient way. As the GPU in this case is assigned to the

Re: [Spice-devel] [RFC PATCH spice-server v3 10/20] stream-channel: Allows to register callback to get new stream request

2017-08-25 Thread Frediano Ziglio
> > I had a similar comment in a different patch during the last version of > the series, but I personally would prefer a signal to handle this > situation. For example, StreamChannel could have a "supported-codecs" > property, Then when a new client connected, or a client disconnected, > it would

Re: [Spice-devel] [RFC PATCH spice-server v3 09/20] stream-channel: Allows not fixed size

2017-08-25 Thread Frediano Ziglio
> > On Wed, 2017-08-23 at 10:14 +0100, Frediano Ziglio wrote: > > Remove the fixed size stream and support any display size. > > > > Signed-off-by: Frediano Ziglio > > --- > > server/stream-channel.c | 31 +-- > > 1 file changed, 25 insertions(+), 6 deletions(-) > >

Re: [Spice-devel] [RFC PATCH spice-server v3 08/20] stream-device: Handle streaming data from device to channel

2017-08-25 Thread Frediano Ziglio
> > On Wed, 2017-08-23 at 10:14 +0100, Frediano Ziglio wrote: > > Handle stream data from device sending to the channel. > > Channel will forward to clients as proper DisplayChannel > > messaging creating and destroying the channel stream as > > needed. > > This last sentence is a bit unclear. Pe

Re: [Spice-devel] [RFC PATCH spice-server v3 06/20] stream-device: Create channel for stream device

2017-08-25 Thread Frediano Ziglio
> > On Wed, 2017-08-23 at 10:14 +0100, Frediano Ziglio wrote: > > So can be used by the device to communicate with the clients. > > > > Signed-off-by: Frediano Ziglio > > --- > > server/stream-device.c | 20 > > 1 file changed, 20 insertions(+) > > > > diff --git a/server/

[Spice-devel] [PATCH spice-server] reds: Inline very simple function

2017-08-25 Thread Frediano Ziglio
reds_get_n_clients is a single line and is used only by spice_server_get_num_clients. The 2 functions have very similar names so inlining reds_get_n_clients does not make code less readable. Signed-off-by: Frediano Ziglio --- server/reds.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions