Re: [Spice-devel] [vdagent-linux v2 3/5] console-kit: implement check for locked session

2016-04-27 Thread Jonathon Jongsma
On Sat, 2016-04-23 at 12:53 +0200, Victor Toso wrote: > We register to read the Lock, Unlock and IdleHintChanged signals from > ConsoleKit.Session. The Lock/Unlock signals should be the right signals for > the > job but not all Desktop Managers implement its locking in a way that trigger > those si

Re: [Spice-devel] [vdagent-linux v2 2/5] build-sys: console-kit with dbus as default

2016-04-27 Thread Jonathon Jongsma
Ahh, I see you removed this check here. In my opinion, if we do use dbus-1 for both backends, this could be squashed into the previous commit. However, I'm still interested in your thoughts about using gdbus. Reviewed-by: Jonathon Jongsma On Sat, 2016-04-23 at 12:53 +0200, Victor Toso wrote: > P

Re: [Spice-devel] [vdagent-linux v2 1/5] session-info: check for a locked session

2016-04-27 Thread Jonathon Jongsma
On Sat, 2016-04-23 at 12:53 +0200, Victor Toso wrote: > Each session back-end can return this information to vdagentd when requested. > > The agent should use this on situations that should not work when session is > locked such as file-transfer-start which is fixed by this patch. > > systemd-log

Re: [Spice-devel] [vdagent-linux v2 6/6] console-kit: include handler for dbus match

2016-04-27 Thread Jonathon Jongsma
On Sat, 2016-04-23 at 12:27 +0200, Victor Toso wrote: > At the moment we request to read signals on ConsoleKit.Seat interface but > later > on we will request to read signals on different interface so moving this to > its > own function helps. > --- > src/console-kit.c | 65 +++

Re: [Spice-devel] [vdagent-linux v2 5/6] console-kit: include signal handler function

2016-04-27 Thread Jonathon Jongsma
On Sat, 2016-04-23 at 12:27 +0200, Victor Toso wrote: > At the moment we are only reading the ActiveSessionChanged signal from > ConsoleKit.Seat but in a later patch we will be reading a few more signals so > it > make sense to move this handler to its own function. > --- > src/console-kit.c | 111

Re: [Spice-devel] [vdagent-linux v2 4/6] console-kit: do not use empty session

2016-04-27 Thread Jonathon Jongsma
On Sat, 2016-04-23 at 12:27 +0200, Victor Toso wrote: > DBus might return empty string for active-session, probably in a non user > session (e.g. gdm). It is better to keep the variable as NULL as we check > against that (but never against empty strings). > --- > src/console-kit.c | 7 ++- > 1

Re: [Spice-devel] [vdagent-linux v2 3/6] console-kit: save verbosity level for debugging

2016-04-27 Thread Jonathon Jongsma
It appears that the systemd implementation of session-info uses LOG_INFO instead of LOG_DEBUG. Probably best to be consistent. Reviewed-by: Jonathon Jongsma On Sat, 2016-04-23 at 12:27 +0200, Victor Toso wrote: > --- > src/console-kit.c | 9 + > 1 file changed, 9 insertions(+) > > dif

Re: [Spice-devel] [vdagent-linux v2 2/6] console-kit: use standard name for session-info var

2016-04-27 Thread Jonathon Jongsma
Fine with me, although I'd be tempted to use something even more readable, such as 'info'. Acked-by: Jonathon Jongsma On Sat, 2016-04-23 at 12:27 +0200, Victor Toso wrote: > Console-kit was the first back-end implement to gather session info. When > systemd integration was implemented with log

[Spice-devel] [PATCH 08/18] Name MainChannelClient methods consistently

2016-04-27 Thread Jonathon Jongsma
Always use main_channel_client_ prefix instead of just main_channel_ in some cases. --- server/main-channel.c | 16 +--- server/main-channel.h | 15 +-- server/reds.c | 19 ++- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/server/m

[Spice-devel] [PATCH 10/18] Move InputsChannelClient to a separate file

2016-04-27 Thread Jonathon Jongsma
Preparation for converting to GObject --- server/Makefile.am | 2 + server/inputs-channel-client.c | 92 ++ server/inputs-channel-client.h | 44 server/inputs-channel.c| 76 ++ server/

[Spice-devel] [PATCH 11/18] Replace RedChannel::clients with GList

2016-04-27 Thread Jonathon Jongsma
Instead of using a Ring, use a GList to store the list of channel clients. This allows us to iterate the clients without poking inside of the client struct to get the channel_link. This is required in order to make the RedChannelClient struct private. --- server/display-channel.c | 64 ---

[Spice-devel] [PATCH 03/18] Don't touch RedClient internals from RedChannelClient

2016-04-27 Thread Jonathon Jongsma
Change red_channel_client_set_migration_seamless() so that it returns a boolean which RedClient can use to update its internal count of num_migrated_channels rather than having RedChannelClient reaching into the internals of RedClient --- server/red-channel.c | 15 ++- 1 file changed,

[Spice-devel] [PATCH 13/18] Replace RedClient::channels with GList

2016-04-27 Thread Jonathon Jongsma
Allows us to not expose the client_link in RedChannelClient. --- server/red-channel.c | 51 --- server/red-channel.h | 5 + 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/server/red-channel.c b/server/red-channel.c index d77cc8

[Spice-devel] [PATCH 06/18] Add red_client_seamless_migration_done_for_channel()

2016-04-27 Thread Jonathon Jongsma
This is a public RedClient API that handles updating itself rather than having the RedChannelClient poke around at the internal structure in rec_channel_client_seamless_migration_done(). --- server/red-channel.c | 35 +++ 1 file changed, 23 insertions(+), 12 deletio

[Spice-devel] [PATCH 16/18] Move CommonGraphicsChannelClient to a separate file

2016-04-27 Thread Jonathon Jongsma
This reduces the direct access to the struct in preparation for GObjectification --- server/Makefile.am | 3 ++ server/common-graphics-channel-client-private.h | 29 server/common-graphics-channel-client.c | 60 + server/co

[Spice-devel] [PATCH 14/18] Limit direct access to DisplayChannelClient

2016-04-27 Thread Jonathon Jongsma
Add a few more methods and accessors so that other files don't need to manipulate the struct members directly. Move the struct definition to a private header which only the dcc-* files will include. --- server/Makefile.am | 1 + server/dcc-encoders.c| 11 +++--- server/dcc-encoders.h

[Spice-devel] [PATCH 04/18] Make red_client_remove_channel() a RedClient method

2016-04-27 Thread Jonathon Jongsma
Explicitly pass RedClient* as first argument to this function, to mirror red_client_add_channel(). This will eventually allow us to separate the implementations of RedClient and RedChannelClient so that they don't need to be poking into the internals of eachother's structs. --- server/red-channel.

[Spice-devel] [PATCH 05/18] Call public RedClient API instead of poking internals

2016-04-27 Thread Jonathon Jongsma
Use red_client_during_migrate_at_target() instead of checking rcc->client->during_target_migrate. --- server/red-channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/red-channel.c b/server/red-channel.c index 2bcf919..a7c4e5b 100644 --- a/server/red-channel.c ++

[Spice-devel] [PATCH 15/18] Add missing include to red-pipe-item.h

2016-04-27 Thread Jonathon Jongsma
This doesn't cause problems at the moment, because the files that include this file also include the other files that are needed, but just for completeness... --- server/red-pipe-item.h | 1 + 1 file changed, 1 insertion(+) diff --git a/server/red-pipe-item.h b/server/red-pipe-item.h index 8bb12b

[Spice-devel] [PATCH 12/18] rename red_channel_peer_ function to red_channel_client_

2016-04-27 Thread Jonathon Jongsma
Use consistent naming --- server/red-channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/red-channel.c b/server/red-channel.c index 6b83fbc..d77cc89 100644 --- a/server/red-channel.c +++ b/server/red-channel.c @@ -597,7 +597,7 @@ static inline void red_channel

[Spice-devel] [PATCH 18/18] Move CursorChannelClient to separate file

2016-04-27 Thread Jonathon Jongsma
--- server/Makefile.am | 2 + server/cursor-channel-client.c | 122 + server/cursor-channel-client.h | 44 +++ server/cursor-channel.c| 104 --- server/cursor-channel.h| 15 + se

[Spice-devel] [PATCH 09/18] Move MainChannelClient to separate file

2016-04-27 Thread Jonathon Jongsma
Preparation for converting to GObject --- server/Makefile.am | 2 + server/inputs-channel.c | 2 +- server/main-channel-client.c | 552 ++ server/main-channel-client.h | 163 server/main-channel.c| 616 +++-

[Spice-devel] [PATCH 07/18] Change new_pipe_item_t function signature

2016-04-27 Thread Jonathon Jongsma
Now that pipe_item_init() does not require a RedChannelClient* argument anymore, the new_pipe_item_t callback function does not ever use the channel client object passed to it. So just remove this and simplify things. --- server/cursor-channel.c | 2 +- server/dcc.c| 15 --

[Spice-devel] [PATCH 01/18] Replace RedCharDevice::on_free_self_token with a signal

2016-04-27 Thread Jonathon Jongsma
From: Christophe Fergeau It's more natural to do things this way with glib, and this allows to remove some coupling between Reds and RedCharDeviceVDIPort. Before this commit, the RedCharDeviceVDIPort has to provide a on_free_self_token() because Reds needs to know about it. With a signal, RedChar

[Spice-devel] [PATCH 02/18] Print warnings on untested code paths

2016-04-27 Thread Jonathon Jongsma
--- server/display-channel.c | 3 +++ server/sound.c | 1 + 2 files changed, 4 insertions(+) diff --git a/server/display-channel.c b/server/display-channel.c index 1f4d66f..3a06305 100644 --- a/server/display-channel.c +++ b/server/display-channel.c @@ -1921,6 +1921,9 @@ void display_ch

[Spice-devel] [PATCH 00/18] Rebased patches from refactory branch (April 27)

2016-04-27 Thread Jonathon Jongsma
Most patches merged, new patches added Christophe Fergeau (1): Replace RedCharDevice::on_free_self_token with a signal Jonathon Jongsma (17): Print warnings on untested code paths Don't touch RedClient internals from RedChannelClient Make red_client_remove_channel() a RedClient method C

Re: [Spice-devel] [spice-gtk PATCH v3] Usbredir: enable lz4 compression

2016-04-27 Thread Marc-André Lureau
Hi - Original Message - > Compressed message type is CompressedData which contains compression > type (1 byte) followed by the uncompressed data size (4 bytes) followed > by the compressed data size (4 bytes) followed by the compressed data > > If SPICE_SPICEVMC_CAP_DATA_COMPRESS_LZ4 capa

[Spice-devel] [protocol PATCH v3] LZ4 compression is now available at the Spicevmc channel

2016-04-27 Thread Snir Sheriber
-New message type for compressed messages has been added to the protocol -SPICE_SPICEVMC_CAP_DATA_COMPRESS_LZ4 capability has been added --- spice/enums.h| 10 ++ spice/protocol.h | 4 2 files changed, 14 insertions(+) diff --git a/spice/enums.h b/spice/enums.h index c6e9840..34

[Spice-devel] [spice-common PATCH v3] Add LZ4 data compression and used it in spicevmc channel

2016-04-27 Thread Snir Sheriber
Compressed message type is CompressedData which contains compression type (1 byte) followed by the uncompressed data size (4 bytes) followed by the compressed data size (4 bytes) followed by the compressed data --- common/client_marshallers.h | 1 + common/messages.h | 7 +++ spice

[Spice-devel] [server PATCH v3] LZ4 compression is now available at the Spicevmc channel

2016-04-27 Thread Snir Sheriber
Compressed message type is CompressedData which contains compression type (1 byte) followed by the uncompressed data size (4 bytes) followed by the compressed data size (4 bytes) followed by the compressed data If SPICE_USBREDIR_CAP_DATA_COMPRESS_LZ4 capability is available && data_size > COMPRESS

[Spice-devel] [spice-gtk PATCH v3] Usbredir: enable lz4 compression

2016-04-27 Thread Snir Sheriber
Compressed message type is CompressedData which contains compression type (1 byte) followed by the uncompressed data size (4 bytes) followed by the compressed data size (4 bytes) followed by the compressed data If SPICE_SPICEVMC_CAP_DATA_COMPRESS_LZ4 capability is available && data_size > COMPRESS

Re: [Spice-devel] [PATCH 12/14] Improve Reds/RedMainChannel interface

2016-04-27 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Thu, 2016-04-21 at 16:43 -0500, Jonathon Jongsma wrote: > From: Christophe Fergeau > > Instead of exporting 2 methods to get number of channels, and to fill > channel information, and use that from the main channel code, it's > better to do everything in one go in

Re: [Spice-devel] [PATCH 08/14] Add RedServerConfig

2016-04-27 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Thu, 2016-04-21 at 16:43 -0500, Jonathon Jongsma wrote: > From: Christophe Fergeau > > This wraps/groups the various parameters that can be set by spice-server > users through the spice_server_set_xxx public API. > --- > Changes since last version: > - free the c

Re: [Spice-devel] [PATCH 04/14] Use GQueue for RedCharDevice::send_queue

2016-04-27 Thread Jonathon Jongsma
Anybody object to me acking this patch despite the fact that I modified it and posted a new version? I'll merge it soon if there are no objections. On Thu, 2016-04-21 at 16:43 -0500, Jonathon Jongsma wrote: > From: Christophe Fergeau > > There was an extra RedCharDeviceMsgToClientItem type who

Re: [Spice-devel] [PATCH 06/14] Rename PipeItem to RedPipeItem

2016-04-27 Thread Jonathon Jongsma
These changes (this patch and the next patch) are pretty mechanical, so the main question is whether anybody objects to this much code churn. Any objections? On Thu, 2016-04-21 at 16:43 -0500, Jonathon Jongsma wrote: > Following internal type naming conventions > --- > No changes since last patc

Re: [Spice-devel] [PATCH 06/14] Rename PipeItem to RedPipeItem

2016-04-27 Thread Frediano Ziglio
> > These changes (this patch and the next patch) are pretty mechanical, so the > main > question is whether anybody objects to this much code churn. Any objections? > > Probably in a few dozen of patches will rename again all these stuff again but for the time being I think it's coherent. Ack

Re: [Spice-devel] [PATCH 04/14] Use GQueue for RedCharDevice::send_queue

2016-04-27 Thread Frediano Ziglio
> > Anybody object to me acking this patch despite the fact that I modified it > and > posted a new version? > > I'll merge it soon if there are no objections. > Acked-by: Frediano Ziglio Frediano > > On Thu, 2016-04-21 at 16:43 -0500, Jonathon Jongsma wrote: > > From: Christophe Fergeau

Re: [Spice-devel] [PATCH 02/14] UpgradeItem: use base PipeItem for refcounting

2016-04-27 Thread Frediano Ziglio
> > No need to re-implement refcounting in this subclass. > --- > > Changes since last version: > - remove the dcc/display parameter from the struct since the previous patch >was added that stored a display pointer in the Drawable struct. > > server/dcc.c | 16 +---

Re: [Spice-devel] [PATCH] Attempt to manage redirection in a way similar to Unix

2016-04-27 Thread Fabiano FidĂȘncio
On Tue, Apr 26, 2016 at 12:29 PM, Frediano Ziglio wrote: > ping > The idea is good, but didn't work according to my tests with a Win7 machine :-\ > - Original Message - >> >> This patch allows remote-viewer to redirect output/error streams to >> files. >> Also if launched from a console

Re: [Spice-devel] [PATCH v2] Store display in Drawable struct

2016-04-27 Thread Frediano Ziglio
> > If the Drawable keeps a pointer to the Display channel that it is > associated with, we can unref it directly and not need to pass the > 'display' parameter separately to the unref function > --- > Changes: > - remove 'dcc' parameer from release_item_after_push() > > I agree that additional