Re: [Spice-devel] [PATCH spice-common v2] codegen: Add some comments

2018-05-09 Thread Lukáš Hrázký
Sorry for being pedantic :) On Wed, 2018-05-09 at 10:05 +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > python_modules/ptypes.py | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > Changes since v1: > - grammar and better comments > >

Re: [Spice-devel] [PATCH spice-common] codegen: Add some comments

2018-05-09 Thread Lukáš Hrázký
On Sun, 2018-05-06 at 13:33 +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > python_modules/ptypes.py | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py > index

Re: [Spice-devel] [PATCH spice-common] codegen: Removed unused get_type methods

2018-05-09 Thread Lukáš Hrázký
ore perhaps better to keep them there (though I didn't really go and see how much sense it makes). But if you insist, Acked-by: Lukáš Hrázký <lhra...@redhat.com> (might also wanna wait a bit to see if someone holds special feelings for them :)) ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel

Re: [Spice-devel] [PATCH spice-server v3 2/2] stream-channel: Send the full frame in a single message

2018-05-09 Thread Lukáš Hrázký
On Tue, 2018-05-08 at 10:26 +0100, Frediano Ziglio wrote: > The current implementation of server and client assumes that a single > data message contains an encoded frame. > This is not a problem for most encoding but for MJPEG this causes > the client to fail decoding. > Collapse frame data into

Re: [Spice-devel] [PATCH spice-server v3 2/2] stream-channel: Send the full frame in a single message

2018-05-09 Thread Lukáš Hrázký
On Wed, 2018-05-09 at 05:18 -0400, Frediano Ziglio wrote: > > > > On Tue, 2018-05-08 at 10:26 +0100, Frediano Ziglio wrote: > > > The current implementation of server and client assumes that a single > > > data message contains an encoded frame. > > > This is not a problem for most encoding but

[Spice-devel] [PATCH spice-streaming-agent 5/9] Unify the structure of write_all() and read_all()

2018-04-27 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/stream-port.cpp | 20 +++- src/stream-port.hpp | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/stream-port.cpp b/src/stream-port.cpp index 526c564..cee63ac 100644 --- a/src/stream-po

[Spice-devel] [PATCH spice-streaming-agent 0/9] nonblocking mode for stream port and some refactor

2018-04-27 Thread Lukáš Hrázký
As a last point, I think there is still a theoretical race possibility with the poll()s with timeout -1. If the agent receives a SIGTERM right before the poll(), the poll() will block and until something happens on the port and until then the agent will not quit. Lukáš Hrázký (9): Use read_a

[Spice-devel] [PATCH spice-streaming-agent 9/9] Refactor and simplify polling for messages to read

2018-04-27 Thread Lukáš Hrázký
Use exceptions for errors, remove the inner loop in read_command, which should practically never do more than one iteration. Handle EINTR from poll and report nothing to read, relying on the enclosing loop to poll for the command on the next iteration. Signed-off-by: Lukáš Hrázký <l

[Spice-devel] [PATCH spice-streaming-agent 6/9] Add a unit test for the stream port

2018-04-27 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/unittests/.gitignore | 1 + src/unittests/Makefile.am | 9 - src/unittests/test-stream-port.cpp | 69 ++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 1006

[Spice-devel] [PATCH spice-streaming-agent 1/9] Use read_all() to read headers of received messages

2018-04-27 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/spice-streaming-agent.cpp | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index 8b3f833..5dd41a9 100644 --- a/src/spice-streaming-agent.cpp +++

[Spice-devel] [PATCH spice-streaming-agent 8/9] Encapsulate the stream port fd and locking

2018-04-27 Thread Lukáš Hrázký
Wrap the streaming virtio port along with the mutex to lock it in a class. Pass the class temporarily around to functions that need it until the functions too are consolidated into the class. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/spice-streaming-agent.cpp

[Spice-devel] [PATCH spice-streaming-agent 7/9] Change the mode to NONBLOCK for the virtio port

2018-04-27 Thread Lukáš Hrázký
In blocking mode, the IO operations block indefinitely if the server closes the virtio port on it's side. Change to non-blocking mode, so that we can quit the streaming agent in case the port gets closed. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/err

[Spice-devel] [PATCH spice-streaming-agent 3/9] Implement an exception hierarchy for ReadError

2018-04-27 Thread Lukáš Hrázký
Introduces an exception hierarchy up to a ReadError class, which is thrown from read_all(). Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/Makefile.am | 2 ++ src/error.cpp | 29 src/error.hpp

[Spice-devel] [PATCH spice-streaming-agent 4/9] Introduce a WriteError exception for write_all()

2018-04-27 Thread Lukáš Hrázký
Update the interface to not return the size written, as it is not needed anymore. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/error.cpp | 3 ++- src/error.hpp | 14 + src/spice-streaming-agent.cp

[Spice-devel] [PATCH spice-streaming-agent 2/9] Move out {read, write}_all() to a separate module

2018-04-27 Thread Lukáš Hrázký
This starts at the bottom and prepares for gradually moving more stuff out of the main file. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/Makefile.am | 2 ++ src/spice-streaming-agent.cpp | 48 - src/stream-port.cpp

Re: [Spice-devel] [PATCH spice-common v2] codegen: Remove duplicate client and server code from ChannelType::resolve

2018-05-17 Thread Lukáš Hrázký
On Wed, 2018-05-16 at 16:35 +0100, Frediano Ziglio wrote: > Code that handled client and server messages check was the same, just > changed some variable names. > Instead use a class to store same information and reuse the code. > This allows easier extension of the 2 path of code. > >

Re: [Spice-devel] [PATCH spice-streaming-agent v2 6/9] Add a unit test for the stream port

2018-05-17 Thread Lukáš Hrázký
On Wed, 2018-05-16 at 12:47 -0400, Frediano Ziglio wrote: > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > > --- > > src/unittests/.gitignore | 1 + > > src/unittests/Makefile.am | 9 - > >

Re: [Spice-devel] [PATCH spice-streaming-agent 3/9] Implement an exception hierarchy for ReadError

2018-05-16 Thread Lukáš Hrázký
On Wed, 2018-05-16 at 11:08 +0200, Christophe de Dinechin wrote: > > On 16 May 2018, at 10:59, Lukáš Hrázký <lhra...@redhat.com> wrote: > > > > On Tue, 2018-05-15 at 16:37 -0400, Frediano Ziglio wrote: > > > > > > > > Introduces an ex

Re: [Spice-devel] [PATCH spice-streaming-agent 5/9] Unify the structure of write_all() and read_all()

2018-05-16 Thread Lukáš Hrázký
really should put that in the commit message. There is nothing more to it, I just picked one way and I think we agree it's better to have the functions unified. So, what do you want me to do? :) > > > > > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > &g

Re: [Spice-devel] [PATCH spice-streaming-agent 4/9] Introduce a WriteError exception for write_all()

2018-05-16 Thread Lukáš Hrázký
On Tue, 2018-05-15 at 16:42 -0400, Frediano Ziglio wrote: > > > > Update the interface to not return the size written, as it is not needed > > anymore. > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > > --- > > src/error

Re: [Spice-devel] [PATCH spice-streaming-agent 3/9] Implement an exception hierarchy for ReadError

2018-05-16 Thread Lukáš Hrázký
On Wed, 2018-05-16 at 05:25 -0400, Frediano Ziglio wrote: > > > > On Tue, 2018-05-15 at 16:37 -0400, Frediano Ziglio wrote: > > > > > > > > Introduces an exception hierarchy up to a ReadError class, which is > > > > thrown from read_all(). &g

Re: [Spice-devel] [PATCH spice-streaming-agent 6/9] Add a unit test for the stream port

2018-05-16 Thread Lukáš Hrázký
On Tue, 2018-05-15 at 16:52 -0400, Frediano Ziglio wrote: > A bit more comments. > > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > > --- > > src/unittests/.gitignore | 1 + > > src/unittests/Makefile.am | 9 - &g

Re: [Spice-devel] [PATCH spice-streaming-agent 5/9] Unify the structure of write_all() and read_all()

2018-05-16 Thread Lukáš Hrázký
t feel this needs much explaining... > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > > --- > > src/stream-port.cpp | 20 +++- > > src/stream-port.hpp | 4 ++-- > > 2 files changed, 13 insertions(+), 11 deletions(-) > > >

Re: [Spice-devel] [PATCH spice-streaming-agent v2 9/9] Refactor and simplify polling for messages to read

2018-05-18 Thread Lukáš Hrázký
e enclosing loop to poll > > for the command on the next iteration. > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > > --- > > src/spice-streaming-agent.cpp | 40 ++-- > > 1 file changed, 14 insertions(+), 26 deletions(

Re: [Spice-devel] [PATCH spice-common v2] codegen: Remove duplicate client and server code from ChannelType::resolve

2018-05-17 Thread Lukáš Hrázký
On Thu, 2018-05-17 at 08:40 -0400, Frediano Ziglio wrote: > > > > On Thu, 2018-05-17 at 07:36 -0400, Frediano Ziglio wrote: > > > > > > > > On Wed, 2018-05-16 at 16:35 +0100, Frediano Ziglio wrote: > > > > > Code that handled client and server messages check was the same, just > > > > > changed

Re: [Spice-devel] [PATCH spice-streaming-agent v2 6/9] Add a unit test for the stream port

2018-05-17 Thread Lukáš Hrázký
On Thu, 2018-05-17 at 09:26 -0400, Frediano Ziglio wrote: > > > > On Thu, 2018-05-17 at 05:24 -0400, Frediano Ziglio wrote: > > > > > > > > On Wed, 2018-05-16 at 12:47 -0400, Frediano Ziglio wrote: > > > > > > >

Re: [Spice-devel] [PATCH spice-streaming-agent v2 6/9] Add a unit test for the stream port

2018-05-17 Thread Lukáš Hrázký
On Thu, 2018-05-17 at 05:24 -0400, Frediano Ziglio wrote: > > > > On Wed, 2018-05-16 at 12:47 -0400, Frediano Ziglio wrote: > > > > > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > > > > --- > > > > src/unitte

Re: [Spice-devel] [PATCH spice-common v2] codegen: Remove duplicate client and server code from ChannelType::resolve

2018-05-17 Thread Lukáš Hrázký
On Thu, 2018-05-17 at 07:36 -0400, Frediano Ziglio wrote: > > > > On Wed, 2018-05-16 at 16:35 +0100, Frediano Ziglio wrote: > > > Code that handled client and server messages check was the same, just > > > changed some variable names. > > > Instead use a class to store same information and reuse

Re: [Spice-devel] [PATCH spice-streaming-agent 6/9] Add a unit test for the stream port

2018-05-16 Thread Lukáš Hrázký
On Wed, 2018-05-16 at 05:43 -0400, Frediano Ziglio wrote: > > On Tue, 2018-05-15 at 16:52 -0400, Frediano Ziglio wrote: > > > A bit more comments. > > > > > > > > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > > > > -

Re: [Spice-devel] [PATCH spice-streaming-agent v2] Add name to an unnamed structure

2018-05-17 Thread Lukáš Hrázký
reaming-agent.cpp > @@ -126,7 +126,7 @@ static void handle_stream_error(size_t len) > > std::to_string(sizeof(StreamMsgNotifyError)) + ")"); > } > > -struct : StreamMsgNotifyError { > +struct StreamMsgNotifyError1K : Strea

[Spice-devel] [PATCH spice-streaming-agent v2 2/9] Move out {read, write}_all() to a separate module

2018-05-16 Thread Lukáš Hrázký
This starts at the bottom and prepares for gradually moving more stuff out of the main file. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/Makefile.am | 2 ++ src/spice-streaming-agent.cpp | 48 - src/stream-port.cpp

[Spice-devel] [PATCH spice-streaming-agent v2 1/9] Use read_all() to read headers of received messages

2018-05-16 Thread Lukáš Hrázký
Unifies the reading from the virtio port, read_all() supports signals and partial reads. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/spice-streaming-agent.cpp | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src

[Spice-devel] [PATCH spice-streaming-agent v2 8/9] Encapsulate the stream port fd and locking

2018-05-16 Thread Lukáš Hrázký
header 3 - data message 4 - cursor message Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/spice-streaming-agent.cpp | 111 +++--- src/stream-port.cpp | 23 + src/stream-port.hpp | 14 ++ 3 files changed, 86 inse

[Spice-devel] [PATCH spice-streaming-agent v2 7/9] Change the mode to NONBLOCK for the virtio port

2018-05-16 Thread Lukáš Hrázký
In blocking mode, the IO operations block indefinitely if the server closes the virtio port on it's side. Change to non-blocking mode, so that we can quit the streaming agent in case the port gets closed. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/err

[Spice-devel] [PATCH spice-streaming-agent v2 4/9] Introduce a WriteError exception for write_all()

2018-05-16 Thread Lukáš Hrázký
Update the interface to not return the size written, as it is not needed anymore. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/error.cpp | 1 - src/error.hpp | 14 + src/spice-streaming-agent.cp

[Spice-devel] [PATCH spice-streaming-agent v2 5/9] Unify the structure of write_all() and read_all()

2018-05-16 Thread Lukáš Hrázký
Both versions are fine, unify for consistency. Use the optically less verbose version. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/stream-port.cpp | 20 +++- src/stream-port.hpp | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/

[Spice-devel] [PATCH spice-streaming-agent v2 9/9] Refactor and simplify polling for messages to read

2018-05-16 Thread Lukáš Hrázký
Use exceptions for errors, remove the inner loop in read_command, which should practically never do more than one iteration. Handle EINTR from poll and report nothing to read, relying on the enclosing loop to poll for the command on the next iteration. Signed-off-by: Lukáš Hrázký <l

[Spice-devel] [PATCH spice-streaming-agent v2 6/9] Add a unit test for the stream port

2018-05-16 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/unittests/.gitignore | 1 + src/unittests/Makefile.am | 9 - src/unittests/test-stream-port.cpp | 69 ++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 1006

[Spice-devel] [PATCH spice-streaming-agent v2 0/9] nonblocking mode for stream port and some refactor

2018-05-16 Thread Lukáš Hrázký
in the WriteError exception. - Fixed the locking in "Encapsulate the stream port fd and locking". Lukáš Hrázký (9): Use read_all() to read headers of received messages Move out {read,write}_all() to a separate module Implement an exception hierarchy for ReadError Introduce a WriteError

[Spice-devel] [PATCH spice-streaming-agent v2 3/9] Implement an exception hierarchy for ReadError

2018-05-16 Thread Lukáš Hrázký
Introduces an exception hierarchy up to a ReadError class, which is thrown from read_all(). Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/Makefile.am | 2 ++ src/error.cpp | 22 ++ src/error.hpp

Re: [Spice-devel] [PATCH spice-streaming-agent 3/9] Implement an exception hierarchy for ReadError

2018-05-16 Thread Lukáš Hrázký
On Tue, 2018-05-15 at 16:37 -0400, Frediano Ziglio wrote: > > > > Introduces an exception hierarchy up to a ReadError class, which is > > thrown from read_all(). > > > > Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> > > --- > > src/Make

Re: [Spice-devel] [PATCH spice-streaming-agent 4/9] Introduce a WriteError exception for write_all()

2018-05-16 Thread Lukáš Hrázký
On Wed, 2018-05-16 at 05:46 -0400, Frediano Ziglio wrote: > > > > On Tue, 2018-05-15 at 16:42 -0400, Frediano Ziglio wrote: > > > > > > > > Update the interface to not return the size written, as it is not needed > > > > anymore. > > > &

Re: [Spice-devel] [PATCH spice-common v3] codegen: Remove duplicate client and server code from ChannelType::resolve

2018-05-23 Thread Lukáš Hrázký
> +info.messages.append(m) > +info.messages_byname[m.name] = m > + > +self.server_messages = server_info.messages > +self.server_messages_byname = server_info.messages_byname > +self.client_messages = client_info.messages > +self.client_messages_byname = client_info.messages_byname > > return self Assuming it works :) Acked-by: Lukáš Hrázký <lhra...@redhat.com> ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Spice-devel] [PATCH spice-streaming-agent v3 5/5] Refactor and simplify polling for messages to read

2018-05-18 Thread Lukáš Hrázký
Use exceptions for errors. Handle EINTR from poll and report nothing to read, relying on the enclosing loop to poll for the command on the next iteration. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/spice-streaming-agent.cpp | 47 ---

[Spice-devel] [PATCH spice-streaming-agent v3 0/5] nonblocking mode for stream port and some refactor

2018-05-18 Thread Lukáš Hrázký
in patch 5/5, it serves to read multiple commands at once. Lukáš Hrázký (5): Add a unit test for the stream port Fix reading from a closed virtio port Change the mode to NONBLOCK for the virtio port Encapsulate the stream port fd and locking Refactor and simplify polling for messages

[Spice-devel] [PATCH spice-streaming-agent v3 3/5] Change the mode to NONBLOCK for the virtio port

2018-05-18 Thread Lukáš Hrázký
In blocking mode, a write to the virtio port blocks indefinitely if the server closes the virtio port on it's side. Change to non-blocking mode, so that we can quit the streaming agent in case the port gets closed. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/spice-str

[Spice-devel] [PATCH spice-streaming-agent v3 1/5] Add a unit test for the stream port

2018-05-18 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/unittests/.gitignore | 1 + src/unittests/Makefile.am | 8 ++ src/unittests/test-stream-port.cpp | 55 ++ 3 files changed, 64 insertions(+) create mode 100644 src/unittest

[Spice-devel] [PATCH spice-streaming-agent v3 2/5] Fix reading from a closed virtio port

2018-05-18 Thread Lukáš Hrázký
Reading from a closed virtio port looped indefinitely, check the read() returning 0 and throw an exception if it happens. Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/error.hpp | 2 ++ src/stream-port.cpp| 4 src/unittests/test-

[Spice-devel] [PATCH spice-streaming-agent v3 4/5] Encapsulate the stream port fd and locking

2018-05-18 Thread Lukáš Hrázký
header 3 - data message 4 - cursor message Signed-off-by: Lukáš Hrázký <lhra...@redhat.com> --- src/spice-streaming-agent.cpp | 111 +++--- src/stream-port.cpp | 23 + src/stream-port.hpp | 14 ++ 3 files changed, 86 inse

Re: [Spice-devel] [RFC/POC PATCH spice-protocol 01/16] Add the StreamInfo message

2018-06-06 Thread Lukáš Hrázký
On Wed, 2018-06-06 at 04:36 -0400, Frediano Ziglio wrote: > > > > On Tue, 2018-06-05 at 17:30 +0200, Lukáš Hrázký wrote: > > > The message is meant to contain information related to the stream, > > > e.g. > > > now the guest (xrandr) output ID of the st

Re: [Spice-devel] [PATCH spice-server v3 2/2] stream-channel: Send the full frame in a single message

2018-06-12 Thread Lukáš Hrázký
On Tue, 2018-06-12 at 13:30 +0200, Christophe Fergeau wrote: > Hey, > > On Wed, May 09, 2018 at 01:20:19PM +0200, Lukáš Hrázký wrote: > > On Wed, 2018-05-09 at 05:18 -0400, Frediano Ziglio wrote: > > > The agent send a single message, but reads/writes to the device ar

Re: [Spice-devel] [PATCH spice-streaming-agent v2 3/5] Starts/stops the agent based on VT status

2018-06-08 Thread Lukáš Hrázký
On Mon, 2018-05-21 at 11:45 +0100, Frediano Ziglio wrote: > Check if the current display server is active or not and stream only if > active. > This will allow to support multiple display servers running. > When multiple display servers are running only one have the GPU > associated and is writing

Re: [Spice-devel] [PATCH spice-streaming-agent v2 4/5] Implement a daemon/agent separation

2018-06-08 Thread Lukáš Hrázký
On Mon, 2018-05-21 at 11:45 +0100, Frediano Ziglio wrote: > This allows to manage properly multiple servers (currently only Xorg). > The executable will run as a service forking the proper agent. > The agent will then manage the active server. > The server receive just minimal information for the

Re: [Spice-devel] [PATCH spice-streaming-agent v2 2/5] Add file with utilities for Xorg

2018-06-08 Thread Lukáš Hrázký
Hi, On Mon, 2018-05-21 at 11:45 +0100, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > src/Makefile.am | 2 ++ > src/spice-streaming-agent.cpp | 1 + > src/xorg-utils.cpp| 40 +++ > src/xorg-utils.hpp| 13

Re: [Spice-devel] [PATCH spice-streaming-agent 8/9] Clean up the global try-catch block

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 05:31 -0400, Frediano Ziglio wrote: > > > > Unify the error handling to use exceptions, narrowing down the exit > > spots for success/error to one each. > > > > Signed-off-by: Lukáš Hrázký > > --- > > src/spice-streaming-ag

Re: [Spice-devel] [RFC/POC PATCH spice-gtk 12/16] Use the new output_id as display ID for the mouse motion event

2018-06-14 Thread Lukáš Hrázký
On Wed, 2018-06-13 at 16:47 -0500, Jonathon Jongsma wrote: > On Tue, 2018-06-05 at 17:30 +0200, Lukáš Hrázký wrote: > > If the output_id is set, it is the true xrandr guest ID to use for > > the > > mouse motion event. If it's not present, keep relying on the wack

Re: [Spice-devel] [PATCH spice-streaming-agent 1/9] Separate the code for logging frames/times into a class

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 06:44 -0400, Frediano Ziglio wrote: > > > > On Thu, 2018-06-14 at 04:42 -0400, Frediano Ziglio wrote: > > > > > > > > The FrameLog class provides RAII for the FILE and encapsulates the > > > > logging functionali

Re: [Spice-devel] [PATCH spice-server v3 2/2] stream-channel: Send the full frame in a single message

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 05:10 -0400, Frediano Ziglio wrote: > > > > On Wed, 2018-06-13 at 07:13 -0400, Frediano Ziglio wrote: > > > > > > > > On Tue, 2018-06-12 at 13:30 +0200, Christophe Fergeau wrote: > > > > > Hey, > > > > >

Re: [Spice-devel] [PATCH spice-streaming-agent 1/9] Separate the code for logging frames/times into a class

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 04:42 -0400, Frediano Ziglio wrote: > > > > The FrameLog class provides RAII for the FILE and encapsulates the > > logging functionality. > > > > Signed-off-by: Lukáš Hrázký > > Why "FrameLog" if, as you said too, is managing

Re: [Spice-devel] [PATCH spice-streaming-agent 2/9] FrameLog: Use std::chrono instead of gettimeofday for time

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 04:45 -0400, Frediano Ziglio wrote: > > > > Signed-off-by: Lukáš Hrázký > > Patch looks good but would be good to state the reasons. > Portability? > Just style? I just prefer to use std::chrono since it's provided by the standard library. It's no

Re: [Spice-devel] [PATCH spice-streaming-agent 4/9] Improve the invalid option argument (-c) error message

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 05:41 -0400, Frediano Ziglio wrote: > > > > Signed-off-by: Lukáš Hrázký > > --- > > src/spice-streaming-agent.cpp | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/spice-streaming-agent.cpp b/src/s

Re: [Spice-devel] [PATCH spice-streaming-agent 7/9] Make the try-catch block in main() a catch-all

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 05:29 -0400, Frediano Ziglio wrote: > > > > Extends the try-catch block to encompass all the business code in > > main(), making it a catch-all for all errors. > > > > Signed-off-by: Lukáš Hrázký > > Idea is good, the patch does not c

Re: [Spice-devel] [PATCH v2 spice-streaming-agent 1/1] Adding gstreamer based plugin

2018-06-18 Thread Lukáš Hrázký
Hi Snir, mostly C++ and error handling notes :) I hope it's not too painful :D On Sun, 2018-06-10 at 11:14 +0300, Snir Sheriber wrote: > Gstreamer based plugin utilizing gstreamer elements to capture > screen from X, convert and encode into h264/vp8/vp9/mjpeg stream > Configure with

[Spice-devel] [PATCH spice-streaming-agent 1/9] Separate the code for logging frames/times into a class

2018-06-13 Thread Lukáš Hrázký
The FrameLog class provides RAII for the FILE and encapsulates the logging functionality. Signed-off-by: Lukáš Hrázký --- While I retained all the behaviour of the original implementation, I don't like it as it is. 1. The class is doing two different things: a) logging the binary frames

[Spice-devel] [PATCH spice-streaming-agent 9/9] Move out the cursor-updating code into it's own class

2018-06-13 Thread Lukáš Hrázký
a socket, so a proper solution might be to integrate this into the loop of the main process. Signed-off-by: Lukáš Hrázký --- src/Makefile.am | 2 + src/cursor-updater.cpp| 106 ++ src/cursor-updater.hpp| 34 +++ src/spice

[Spice-devel] [PATCH spice-streaming-agent 7/9] Make the try-catch block in main() a catch-all

2018-06-13 Thread Lukáš Hrázký
Extends the try-catch block to encompass all the business code in main(), making it a catch-all for all errors. Signed-off-by: Lukáš Hrázký --- src/spice-streaming-agent.cpp | 46 +-- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/spice

[Spice-devel] [PATCH spice-streaming-agent 3/9] Remove the arg_error macro

2018-06-13 Thread Lukáš Hrázký
It doesn't help anything. Signed-off-by: Lukáš Hrázký --- src/spice-streaming-agent.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index aef49c7..ca10d3b 100644 --- a/src/spice-streaming-agent.cpp +++ b

[Spice-devel] [PATCH spice-streaming-agent 6/9] Remove the logmask variable

2018-06-13 Thread Lukáš Hrázký
The variable is unnecessary, we can pass the value straight to setlogmask(). Signed-off-by: Lukáš Hrázký --- src/spice-streaming-agent.cpp | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index 392936a

[Spice-devel] [PATCH spice-streaming-agent 0/9] More refactor and separation

2018-06-13 Thread Lukáš Hrázký
... Lukáš Hrázký (9): Separate the code for logging frames/times into a class FrameLog: Use std::chrono instead of gettimeofday for time Remove the arg_error macro Improve the invalid option argument (-c) error message Introduce a short class to have RAII on the syslog Remove

[Spice-devel] [PATCH spice-streaming-agent 8/9] Clean up the global try-catch block

2018-06-13 Thread Lukáš Hrázký
Unify the error handling to use exceptions, narrowing down the exit spots for success/error to one each. Signed-off-by: Lukáš Hrázký --- src/spice-streaming-agent.cpp | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice

[Spice-devel] [PATCH spice-streaming-agent 4/9] Improve the invalid option argument (-c) error message

2018-06-13 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký --- src/spice-streaming-agent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index ca10d3b..d5ed034 100644 --- a/src/spice-streaming-agent.cpp +++ b/src/spice-streaming-agent.cpp

[Spice-devel] [PATCH spice-streaming-agent 2/9] FrameLog: Use std::chrono instead of gettimeofday for time

2018-06-13 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký --- src/frame-log.cpp | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/frame-log.cpp b/src/frame-log.cpp index b0bd09e..4418d09 100644 --- a/src/frame-log.cpp +++ b/src/frame-log.cpp @@ -9,9 +9,9 @@ #include "error.hpp"

[Spice-devel] [PATCH spice-streaming-agent 5/9] Introduce a short class to have RAII on the syslog

2018-06-13 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký --- src/spice-streaming-agent.cpp | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/spice-streaming-agent.cpp b/src/spice-streaming-agent.cpp index d5ed034..392936a 100644 --- a/src/spice-streaming-agent.cpp +++ b/src/spice

Re: [Spice-devel] [PATCH spice-server v3 2/2] stream-channel: Send the full frame in a single message

2018-06-13 Thread Lukáš Hrázký
On Wed, 2018-06-13 at 07:13 -0400, Frediano Ziglio wrote: > > > > On Tue, 2018-06-12 at 13:30 +0200, Christophe Fergeau wrote: > > > Hey, > > > > > > On Wed, May 09, 2018 at 01:20:19PM +0200, Lukáš Hrázký wrote: > > > > On We

Re: [Spice-devel] [PATCH spice-streaming-agent 1/9] Separate the code for logging frames/times into a class

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 16:22 +0200, Christophe de Dinechin wrote: > > On 13 Jun 2018, at 14:06, Lukáš Hrázký wrote: > > > > The FrameLog class provides RAII for the FILE and encapsulates the > > logging functionality. > > > > Signed-off-by: Lukáš Hráz

Re: [Spice-devel] [PATCH spice-streaming-agent 1/9] Separate the code for logging frames/times into a class

2018-06-14 Thread Lukáš Hrázký
> > The FrameLog class provides RAII for the FILE and encapsulates the > > > > > > logging functionality. > > > > > > > > > > > > Signed-off-by: Lukáš Hrázký > > > > > > > > > > Why "FrameLog" if, as you sai

Re: [Spice-devel] [RFC/POC PATCH spice-gtk 07/16] Rework the handling of monitors_config

2018-06-14 Thread Lukáš Hrázký
gt; attempts. In my tests, it actually does that only if you had two monitors (or whatever number of your monitors is) enabled in the guest before. If you only have one, then starting e.g. `remote-viewer -f ...` will only give you one fullscreen client window :/ Cheers, Lukas &

Re: [Spice-devel] [RFC/POC PATCH 00/16] add output_id to monitors_config

2018-06-15 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 21:12 +0200, Marc-André Lureau wrote: > Hi > > On Tue, Jun 5, 2018 at 5:30 PM, Lukáš Hrázký wrote: > > Hi everyone, > > > > following is my attempt at solving the ID issues with monitors_config > > and streaming. The concept is as foll

Re: [Spice-devel] [RFC/POC PATCH 00/16] add output_id to monitors_config

2018-06-15 Thread Lukáš Hrázký
On Fri, 2018-06-15 at 12:24 +0200, Marc-André Lureau wrote: > Hi > > On Fri, Jun 15, 2018 at 12:16 PM, Lukáš Hrázký wrote: > > On Thu, 2018-06-14 at 21:12 +0200, Marc-André Lureau wrote: > > > Hi > > > > > > On Tue, Jun 5, 2018 at 5:30 PM

Re: [Spice-devel] [RFC/POC PATCH spice-protocol 02/16] Create a version 2 of the VDAgentMonitorsConfig message

2018-06-14 Thread Lukáš Hrázký
On Thu, 2018-06-14 at 08:37 -0500, Jonathon Jongsma wrote: > On Tue, 2018-06-05 at 17:30 +0200, Lukáš Hrázký wrote: > > To keep compatibility with old endpoints (any of client, server, > > vd_agent), we need to copy the message to add the output_id field. > > > > The

Re: [Spice-devel] [RFC/POC PATCH 00/16] add output_id to monitors_config

2018-06-15 Thread Lukáš Hrázký
On Fri, 2018-06-15 at 15:12 +0200, Marc-André Lureau wrote: > Hi > > On Fri, Jun 15, 2018 at 1:01 PM, Lukáš Hrázký wrote: > > On Fri, 2018-06-15 at 12:24 +0200, Marc-André Lureau wrote: > > > Hi > > > > > > On Fri, Jun 15, 2018 at 12:16 PM, Lukáš Hrázk

Re: [Spice-devel] [RFC/POC PATCH spice-protocol 02/16] Create a version 2 of the VDAgentMonitorsConfig message

2018-06-19 Thread Lukáš Hrázký
On Tue, 2018-06-19 at 15:41 +0200, Christophe de Dinechin wrote: > > On 5 Jun 2018, at 17:30, Lukáš Hrázký wrote: > > > > To keep compatibility with old endpoints (any of client, server, > > vd_agent), we need to copy the message to add the output_id field. > >

Re: [Spice-devel] [PATCH spice-streaming-agent v3 1/5] Install udev rule

2018-06-01 Thread Lukáš Hrázký
On Fri, 2018-06-01 at 04:56 -0400, Frediano Ziglio wrote: > > > > On 06/01/2018 12:12 AM, Frediano Ziglio wrote: > > > > > > > > On 05/23/2018 12:03 PM, Frediano Ziglio wrote: > > > > > The udev rule is used to do some action when the device is added to > > > > > the > > > > > system. Current

[Spice-devel] [RFC/POC PATCH spice 05/16] Handle the StreamInfo message from the streaming agent

2018-06-05 Thread Lukáš Hrázký
The StreamInfo message contains the guest (xrandr) output ID of the monitor that is being streamed. It will later be passed to the client in the MonitorsConfig message. --- server/red-stream-device.c | 43 -- server/stream-channel.c| 14 +++--

[Spice-devel] [RFC/POC PATCH spice 06/16] Use VDAgentMonitorsConfigV2 that contains the output_id field

2018-06-05 Thread Lukáš Hrázký
The VDAgentMonitorsConfig message is sent from the client to the server and possibly passed on to the vd_agent. Use the version 2 (V2 suffix) that contains the guest (xrandr) output ID of the monitor. The output ID is only useful if the message is passed to the vd_agent, as it is an ID in the

[Spice-devel] [RFC/POC PATCH spice-streaming-agent 04/16] Send a StreamInfo message when starting to stream

2018-06-05 Thread Lukáš Hrázký
The StreamInfo message contanis information about the new stream, e.g. the guest (xrandr) output ID of the monitor that is being streamed. --- configure.ac | 2 +- src/spice-streaming-agent.cpp | 22 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff

[Spice-devel] [RFC/POC PATCH spice-gtk 07/16] Rework the handling of monitors_config

2018-06-05 Thread Lukáš Hrázký
that to look up the correct monitor_config. Signed-off-by: Lukáš Hrázký --- spice-common | 2 +- src/channel-display.c| 23 ++- src/channel-main.c | 139 --- src/channel-main.h | 2 +- src/map-file | 5 ++ src

[Spice-devel] [RFC/POC PATCH 00/16] add output_id to monitors_config

2018-06-05 Thread Lukáš Hrázký
-by line, since they are not for merging, should not be an issue... Lukáš Hrázký (16): spice-protocol Add the StreamInfo message Create a version 2 of the VDAgentMonitorsConfig message spice-common add output_id to SpiceMsgDisplayMonitorsConfig spice-streaming-agent Send a StreamInfo message

[Spice-devel] [RFC/POC PATCH spice-protocol 02/16] Create a version 2 of the VDAgentMonitorsConfig message

2018-06-05 Thread Lukáš Hrázký
by the streaming agent. It is later used in the guest by vd_agent for mouse input and possibly monitors_config (enabling/disabling monitors and setting the resolution/position of monitors). Signed-off-by: Lukáš Hrázký --- spice/vd_agent.h | 27 +++ 1 file changed, 27

[Spice-devel] [RFC/POC PATCH spice-common 03/16] add output_id to SpiceMsgDisplayMonitorsConfig

2018-06-05 Thread Lukáš Hrázký
TODO: To keep backwards compatibility, the message needs to be copied under a new name and the output_id field added to the copy, then used. --- common/messages.h | 1 + spice.proto | 1 + 2 files changed, 2 insertions(+) diff --git a/common/messages.h b/common/messages.h index

[Spice-devel] [RFC/POC PATCH spice-protocol 01/16] Add the StreamInfo message

2018-06-05 Thread Lukáš Hrázký
The message is meant to contain information related to the stream, e.g. now the guest (xrandr) output ID of the streamed monitor. Signed-off-by: Lukáš Hrázký --- spice/stream-device.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/spice/stream-device.h b/spice/stream

[Spice-devel] [RFC/POC PATCH vd_agent 16/16] vdagent: Use output_id from VDAgentMonitorsConfigV2

2018-06-05 Thread Lukáš Hrázký
When output_id is set in any VDAgentMonConfigV2 struct of the VDAgentMonitorsConfigV2 message, it means the monitor is streamed from the guest by the streaming agent. In that case, we only regard the monitor configs with output_id set as relevant, as those are surely configured for X11, but there

[Spice-devel] [RFC/POC PATCH vd_agent 15/16] Use VDAgentMonitorsConfigV2 instead of VDAgentMonitorsConfig

2018-06-05 Thread Lukáš Hrázký
VDAgentMonitorsConfigV2 contains the output_id field. TODO: Add a capability and check for the version of the message to use. --- src/vdagent/vdagent.c| 2 +- src/vdagent/x11-priv.h | 2 +- src/vdagent/x11-randr.c | 32 src/vdagent/x11.h| 2 +-

[Spice-devel] [RFC/POC PATCH spice-gtk 12/16] Use the new output_id as display ID for the mouse motion event

2018-06-05 Thread Lukáš Hrázký
If the output_id is set, it is the true xrandr guest ID to use for the mouse motion event. If it's not present, keep relying on the wacky sequence of IDs of channel_id + monitor_id. --- src/spice-widget.c | 30 +- 1 file changed, 29 insertions(+), 1 deletion(-) diff

[Spice-devel] [RFC/POC PATCH spice-gtk 09/16] Use an 'enabled' flag instead of status enum in monitors_config

2018-06-05 Thread Lukáš Hrázký
The 3-state SpiceDisplayState enum is no longer needed, as there are no items in the UNDEFINED state in the list of monitor_configs anymore. --- src/channel-main.c | 10 -- src/map-file| 1 - src/spice-glib-sym-file | 1 - src/spice-session.c | 2 +-

[Spice-devel] [RFC/POC PATCH vd_agent 13/16] vdagent: Log the diddly doo X11 error

2018-06-05 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký --- src/vdagent/x11-randr.c | 4 1 file changed, 4 insertions(+) diff --git a/src/vdagent/x11-randr.c b/src/vdagent/x11-randr.c index 803cf73..84c75f2 100644 --- a/src/vdagent/x11-randr.c +++ b/src/vdagent/x11-randr.c @@ -38,6 +38,10 @@ static int

[Spice-devel] [RFC/POC PATCH vd_agent 14/16] Improve/add some logging messages

2018-06-05 Thread Lukáš Hrázký
Signed-off-by: Lukáš Hrázký --- src/vdagent/vdagent.c | 2 ++ src/vdagent/x11-randr.c | 23 +++ src/vdagentd/uinput.c | 4 ++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/vdagent/vdagent.c b/src/vdagent/vdagent.c index 3f8ef31..c5e5952 100644

[Spice-devel] [RFC/POC PATCH spice-gtk 08/16] Remove the n_display_channels check when sending monitors_config

2018-06-05 Thread Lukáš Hrázký
We're now always sending the number monitors that we received from all the display channels' monitors_configs, so this check no longer makes sense. --- src/channel-main.c | 22 +- src/spice-session-priv.h | 3 +-- src/spice-session.c | 13 + 3 files

[Spice-devel] [RFC/POC PATCH spice-gtk 10/16] Use VDAgentMonitorsConfigV2 as the message for monitors_config

2018-06-05 Thread Lukáš Hrázký
The version 2 of the message adds the output_id field. Signed-off-by: Lukáš Hrázký --- src/channel-main.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/channel-main.c b/src/channel-main.c index 72cc070..8b2c031 100644 --- a/src/channel-main.c +++ b

[Spice-devel] [RFC/POC PATCH spice-gtk 11/16] Add output_id to the monitors_config

2018-06-05 Thread Lukáš Hrázký
Use the new output_id field in the message from the client, store it in the monitor_configs array in the session and pass it to the server and subsequently vd_agent in the VDAgentMonitorsConfigV2 message. Signed-off-by: Lukáš Hrázký --- src/channel-display.c | 14 -- src/channel

  1   2   3   4   5   6   >