[Spice-devel] [PATCH spice-gtk v3 2/5] Avoid warning about snprintf on non-Linux platforms

2017-05-16 Thread Christophe de Dinechin
From: Christophe de Dinechin Without #include , calls to snprintf in the file cause a warning. The file is left aside on purpose, since src/usbutil.c may be compiled on Windows where this file does not exist. Signed-off-by: Christophe de Dinechin --- src/usbutil.c | 2 +- 1 file changed, 1 in

[Spice-devel] [PATCH spice-gtk v3 0/5] macOS fixes for spicy

2017-05-16 Thread Christophe de Dinechin
From: Christophe de Dinechin This patch set mostly eliminates warnings detected by clang with respect to type alignments. Vittorio Toso had submitted something similar. In this version, I took into account comments by Christophe Fergeau regarding how to know which casts were aligned and which one

[Spice-devel] [PATCH spice-gtk v3 5/5] Use SPICE_ALIGNED_CAST to silence warning with ucontext on macOS

2017-05-16 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- configure.ac| 3 ++- src/channel-cursor.c| 6 +++--- src/channel-display-mjpeg.c | 2 +- src/continuation.h | 6 -- src/decode-glz-tmpl.c | 2 +- src/spice-channel.c |

[Spice-devel] [PATCH spice-gtk v3 4/5] Add check for macOS, disable ucontext on macOS (deprecated)

2017-05-16 Thread Christophe de Dinechin
From: Christophe de Dinechin Signed-off-by: Christophe de Dinechin --- configure.ac | 14 ++ 1 file changed, 14 insertions(+) diff --git a/configure.ac b/configure.ac index 74b5811..ecab365 100644 --- a/configure.ac +++ b/configure.ac @@ -62,6 +62,18 @@ esac AC_MSG_RESULT([$os_win

[Spice-devel] [PATCH spice-gtk v3 1/5] Avoid clang warnings on casts with stricter alignment requirements

2017-05-16 Thread Christophe de Dinechin
From: Christophe de Dinechin For example, something like this: uint8_t *p8; uint32_t *p32 = (uint32_t *) p8; generates a warning like this: spice-channel.c:1350:10: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'uint32_t *' (aka 'unsigned int *') increases required al

[Spice-devel] [PATCH spice-gtk v3 3/5] Remove warning about unused variable when building on macOS

2017-05-16 Thread Christophe de Dinechin
From: Christophe de Dinechin On macOS, neither of the two cases implemented in set_mouse_accel applies. We get the following eror message: CC spice-widget.lo spice-widget.c:944:26: error: unused variable 'd' [-Werror,-Wunused-variable] SpiceDisplayPrivate *d = display->priv; Signed-

[Spice-devel] [PATCH v2 2/4] vdagent: move file xfer initialization to a function

2017-05-16 Thread Victor Toso
From: Victor Toso This patch creates two functions: - xfer_get_download_directory() - vdagent_init_file_xfer() The logic should be similar as it was before this patch, taking in consideration the global variables fx_open_dir and fx_dir which are set from command line. Signed-off-by: Victor Toso

[Spice-devel] [PATCH v2 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Victor Toso
From: Victor Toso As we already depend on glib, let's remove code that glib can take care. In this case, we don't need to handle commandline parsing ourselves. In regard the global variables: * static const char * -> static char * [only paths] path variables: portdev, fx_dir, vdagentd_socket

[Spice-devel] [PATCH v2 3/4] vdagent: move file xfer finalize to a function

2017-05-16 Thread Victor Toso
From: Victor Toso This patch creates vdagent_finalize_file_xfer() to finalize and stop file xfer. Moving this code to a function removes some duplication. Signed-off-by: Victor Toso --- src/vdagent/vdagent.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) dif

[Spice-devel] [PATCH v2 1/4] vdagentd-proto: define default virtio-port path

2017-05-16 Thread Victor Toso
From: Victor Toso This adds a #define to avoid hardcoding the path in 2 different places. Signed-off-by: Victor Toso Acked-by: Christophe Fergeau --- src/vdagent/vdagent.c | 2 +- src/vdagentd-proto.h| 2 ++ src/vdagentd/vdagentd.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-

[Spice-devel] [PATCH v2 0/4] Command line parsing with Glib

2017-05-16 Thread Victor Toso
From: Victor Toso -- v1->v2: * 01/04 - Improve commit log to make the change clear (Christophe) - Acked * 02/04 - Make function type with function name in the same line - Return const gchar* in xfer_get_download_directory; (Pavel) - Explicit pointer comparison to NULL (Pavel) - Renamed: vdagent_

[Spice-devel] [vdagentd-linux] vdagentd: Do not call session_info_is_user() with invalid session_info

2017-05-16 Thread Victor Toso
From: Victor Toso If we pass -X command line option which disables console-kit/systemd-logind integration, we will have the following critical being issued: CRITICAL **: session_info_is_user: assertion 'si != NULL' failed This patch avoid it. Signed-off-by: Victor Toso --- src/vdagentd/vda

Re: [Spice-devel] OT Re: [spice-gtk] glz: Remove unused DECODE_TO_SAME array

2017-05-16 Thread Victor Toso
Hi, On Tue, May 16, 2017 at 12:29:16PM -0400, Frediano Ziglio wrote: > My script says (not checked): Can you share it? :) > Unused functions: > canvas_create > g_cclosure_user_marshal_VOID__OBJECT_OBJECT > spice_display_get_pixbuf > spice_display_key_event_get_type >

Re: [Spice-devel] [PATCH spice-gtk v2 1/4] Avoid clang warnings on casts with stricter alignment requirements

2017-05-16 Thread Christophe de Dinechin
> On 16 May 2017, at 16:51, Christophe Fergeau wrote: > > Hey, > > On Thu, May 11, 2017 at 12:47:05PM +0200, Christophe de Dinechin wrote: >> From: Christophe de Dinechin >> >> For example, something like this: >>uint8_t *p8; >>uint32_t *p32 = (uint32_t *) p8; >> >> generates a warn

Re: [Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Victor Toso
On Tue, May 16, 2017 at 12:32:35PM -0400, Frediano Ziglio wrote: > > > > On Tue, May 16, 2017 at 06:07:00PM +0200, Victor Toso wrote: > > > Hi, > > > > > > On Tue, May 16, 2017 at 05:29:57PM +0200, Christophe Fergeau wrote: > > > > On Fri, May 12, 2017 at 01:19:40PM +0200, Victor Toso wrote: > >

Re: [Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Frediano Ziglio
> > On Tue, May 16, 2017 at 06:07:00PM +0200, Victor Toso wrote: > > Hi, > > > > On Tue, May 16, 2017 at 05:29:57PM +0200, Christophe Fergeau wrote: > > > On Fri, May 12, 2017 at 01:19:40PM +0200, Victor Toso wrote: > > > > From: Victor Toso > > > > > > > > As we already depend on glib, let's r

Re: [Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Victor Toso
Hi, On Tue, May 16, 2017 at 06:27:54PM +0200, Christophe Fergeau wrote: > On Tue, May 16, 2017 at 06:07:00PM +0200, Victor Toso wrote: > > Hi, > > > > On Tue, May 16, 2017 at 05:29:57PM +0200, Christophe Fergeau wrote: > > > On Fri, May 12, 2017 at 01:19:40PM +0200, Victor Toso wrote: > > > > Fro

[Spice-devel] OT Re: [spice-gtk] glz: Remove unused DECODE_TO_SAME array

2017-05-16 Thread Frediano Ziglio
My script says (not checked): Unused functions: canvas_create g_cclosure_user_marshal_VOID__OBJECT_OBJECT spice_display_get_pixbuf spice_display_key_event_get_type spice_display_mouse_ungrab spice_display_new spice_display_send_keys s

Re: [Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Christophe Fergeau
On Tue, May 16, 2017 at 06:07:00PM +0200, Victor Toso wrote: > Hi, > > On Tue, May 16, 2017 at 05:29:57PM +0200, Christophe Fergeau wrote: > > On Fri, May 12, 2017 at 01:19:40PM +0200, Victor Toso wrote: > > > From: Victor Toso > > > > > > As we already depend on glib, let's remove code that gli

Re: [Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Victor Toso
Hi, On Tue, May 16, 2017 at 11:45:10AM -0400, Frediano Ziglio wrote: > > > > From: Victor Toso > > > > As we already depend on glib, let's remove code that glib can take > > care. In this case, we don't need to handle commandline parsing > > ourselves. > > > > In regard the global variables: >

Re: [Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Victor Toso
Hi, On Tue, May 16, 2017 at 05:29:57PM +0200, Christophe Fergeau wrote: > On Fri, May 12, 2017 at 01:19:40PM +0200, Victor Toso wrote: > > From: Victor Toso > > > > As we already depend on glib, let's remove code that glib can take > > care. In this case, we don't need to handle commandline pars

Re: [Spice-devel] [PATCH 1/4] vdagentd-proto: define default virtio-port path

2017-05-16 Thread Victor Toso
Hi, On Tue, May 16, 2017 at 05:27:01PM +0200, Christophe Fergeau wrote: > Took me a few seconds to understand what this is about ;) This adds a > #define to avoid hardcoding the path in 2 different places. At first I > thought you were forcing a (new) default value. > > Acked-by: Christophe Fergea

Re: [Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Frediano Ziglio
> > From: Victor Toso > > As we already depend on glib, let's remove code that glib can take > care. In this case, we don't need to handle commandline parsing > ourselves. > > In regard the global variables: > > * static const char * -> static char * [only paths] > path variables: portdev, f

Re: [Spice-devel] [PATCH 4/4] vdagent: Use glib's commandline parser

2017-05-16 Thread Christophe Fergeau
On Fri, May 12, 2017 at 01:19:40PM +0200, Victor Toso wrote: > From: Victor Toso > > As we already depend on glib, let's remove code that glib can take > care. In this case, we don't need to handle commandline parsing > ourselves. > > In regard the global variables: > > * static const char * ->

Re: [Spice-devel] [PATCH 1/4] vdagentd-proto: define default virtio-port path

2017-05-16 Thread Christophe Fergeau
Took me a few seconds to understand what this is about ;) This adds a #define to avoid hardcoding the path in 2 different places. At first I thought you were forcing a (new) default value. Acked-by: Christophe Fergeau Christophe On Fri, May 12, 2017 at 01:19:37PM +0200, Victor Toso wrote: > Fro

Re: [Spice-devel] [spice-gtk] glz: Remove unused DECODE_TO_SAME array

2017-05-16 Thread Victor Toso
Hi, On Tue, May 16, 2017 at 05:12:42PM +0200, Christophe Fergeau wrote: > This also removes the generation of unneeded _decode methods once this > array is removed (this causes some warnings otherwise). > > DECODE_TO_SAME was used in the old client, but was never used when this > code was moved ov

[Spice-devel] [spice-gtk] glz: Remove unused DECODE_TO_SAME array

2017-05-16 Thread Christophe Fergeau
This also removes the generation of unneeded _decode methods once this array is removed (this causes some warnings otherwise). DECODE_TO_SAME was used in the old client, but was never used when this code was moved over to spice-gtk. Signed-off-by: Christophe Fergeau --- src/decode-glz.c | 21 --

Re: [Spice-devel] [PATCH spice-gtk v3 1/6] display-gst: check codec type before creating decoder

2017-05-16 Thread Victor Toso
On Tue, May 16, 2017 at 04:48:13PM +0200, Victor Toso wrote: > From: Victor Toso > > Inserting this check in channel-display-gst.c as the GStreamer decoder > is the only one handling all the different video formats supported by > spice-protocol. > > If a unsupported/bad codec type value was sent

Re: [Spice-devel] [PATCH spice-gtk v2 1/4] Avoid clang warnings on casts with stricter alignment requirements

2017-05-16 Thread Christophe Fergeau
Hey, On Thu, May 11, 2017 at 12:47:05PM +0200, Christophe de Dinechin wrote: > From: Christophe de Dinechin > > For example, something like this: > uint8_t *p8; > uint32_t *p32 = (uint32_t *) p8; > > generates a warning like this: > spice-channel.c:1350:10: error: cast from 'uint8_t

[Spice-devel] [PATCH spice-gtk v3 3/6] display-gst: include capabilities for h264

2017-05-16 Thread Victor Toso
From: Victor Toso As the comment states, incomplete GstCaps for h264 could trigger errors in h264parse element, such as: gst_h264_parse_set_caps: video/x-h264 caps without codec_data or stream-format This would make h264parse to ignore the capabilities that were set. As spice-server is enc

[Spice-devel] [PATCH spice-gtk v3 5/6] display-gst: check GstRegistry for decoding elements

2017-05-16 Thread Victor Toso
From: Victor Toso With this patch, we can find all the elements in the registry that are video decoders which can handle the predefined GstCaps. Main benefits are: - We don't rely on predefined list of GstElements. We don't need to update them; - debugging: It does help to know what the regist

[Spice-devel] [PATCH spice-gtk v3 2/6] display-gst: remove SPICE_GSTVIDEO_AUTO check

2017-05-16 Thread Victor Toso
From: Victor Toso By using this environment variable, we could use decodebin to let GStreamer automatically find the best elements to get the streaming decoded. It was disable by default, in an attempt to have a easy way to test it. Follow up patch will use Playbin to create the pipeline which d

[Spice-devel] [PATCH spice-gtk v3 1/6] display-gst: check codec type before creating decoder

2017-05-16 Thread Victor Toso
From: Victor Toso Inserting this check in channel-display-gst.c as the GStreamer decoder is the only one handling all the different video formats supported by spice-protocol. If a unsupported/bad codec type value was sent, spice-gtk will fail to create the decoder and any messages related to thi

[Spice-devel] [PATCH spice-gtk v3 6/6] display-gst: Use Playbin for GStreamer 1.9.0 onwards

2017-05-16 Thread Victor Toso
From: Victor Toso The Playbin can provide the full pipeline which reduces the overall maintenance in the code as we don't need to track which decoder can work with our stream type. We need to maintain the GstCaps per SPICE_VIDEO_CODEC_TYPE in order to tell Playbin the type of data we expect. Thi

[Spice-devel] [PATCH spice-gtk v3 0/6] Always use Playbin to create the pipeline

2017-05-16 Thread Victor Toso
From: Victor Toso -- v2->v3: * Apply acked in - display-gst: check GstRegistry for decoding elements * display-gst: include capabilities for h264 - Got the errors from h264parse related to incomplete capabilities. Not sure how I missed it before. The error points out that video/x-h264 is n

[Spice-devel] [PATCH spice-gtk v3 4/6] display-gst: move "caps=" from struct to pipeline

2017-05-16 Thread Victor Toso
From: Victor Toso This way we have a map of the necessary GstCaps to a given SPICE_VIDEO_CODEC_TYPE. This patch is also a preparatory patch to: - Identify which GstElements in GstRegistry can handle this GstCaps - Use Playbin as wrapper to all elements beside GstAppSrc and GstAppSink. In thi

Re: [Spice-devel] [PATCH spice-gtk v2 3/4] Remove warning about unused variable when building on macOS

2017-05-16 Thread Christophe de Dinechin
> On 16 May 2017, at 15:15, Frediano Ziglio wrote: > >> >> On Thu, May 11, 2017 at 12:47:07PM +0200, Christophe de Dinechin wrote: >>> From: Christophe de Dinechin >>> >>> On macOS, neither of the two cases implemented in set_mouse_accel applies. >>> We get the following eror message: >>> >>

Re: [Spice-devel] [PATCH spice-gtk v2 2/4] Avoid warning about snprintf on non-Linux platforms

2017-05-16 Thread Christophe de Dinechin
> On 16 May 2017, at 15:00, Christophe Fergeau wrote: > > On Thu, May 11, 2017 at 12:47:06PM +0200, Christophe de Dinechin wrote: >> From: Christophe de Dinechin >> >> Without #include , calls to snprintf in the file >> cause a warning. The file is left aside on purpose, >> since src/usbutil.

Re: [Spice-devel] [PATCH spice-gtk v2 3/4] Remove warning about unused variable when building on macOS

2017-05-16 Thread Frediano Ziglio
> On Thu, May 11, 2017 at 12:47:07PM +0200, Christophe de Dinechin wrote: > > From: Christophe de Dinechin > > > > On macOS, neither of the two cases implemented in set_mouse_accel applies. > > We get the following eror message: > > > > CC spice-widget.lo > > spice-widget.c:944:26: erro

Re: [Spice-devel] [PATCH spice-gtk v2 2/4] Avoid warning about snprintf on non-Linux platforms

2017-05-16 Thread Frediano Ziglio
> > On Thu, May 11, 2017 at 12:47:06PM +0200, Christophe de Dinechin wrote: > > From: Christophe de Dinechin > > > > Without #include , calls to snprintf in the file > > cause a warning. The file is left aside on purpose, > > since src/usbutil.c may be compiled on Windows where this > > file do

Re: [Spice-devel] [PATCH spice-gtk v2 3/4] Remove warning about unused variable when building on macOS

2017-05-16 Thread Christophe Fergeau
On Thu, May 11, 2017 at 12:47:07PM +0200, Christophe de Dinechin wrote: > From: Christophe de Dinechin > > On macOS, neither of the two cases implemented in set_mouse_accel applies. > We get the following eror message: > > CC spice-widget.lo > spice-widget.c:944:26: error: unused variabl

Re: [Spice-devel] [PATCH spice-gtk v2 2/4] Avoid warning about snprintf on non-Linux platforms

2017-05-16 Thread Christophe Fergeau
On Thu, May 11, 2017 at 12:47:06PM +0200, Christophe de Dinechin wrote: > From: Christophe de Dinechin > > Without #include , calls to snprintf in the file > cause a warning. The file is left aside on purpose, > since src/usbutil.c may be compiled on Windows where this > file does not exist. I'

Re: [Spice-devel] [PATCH spice] Add "fall through" comments where necessary

2017-05-16 Thread Frediano Ziglio
> > Make gcc 7.0.1 happy > --- > I am unable to compile using defaults on Fedora 26 Gcc 7 is now released. Patch still apply and works correctly, Acked-by: Frediano Ziglio Frediano > --- > server/dcc.c| 3 ++- > server/inputs-channel.c | 2 +- > server/reds.c | 2 ++ >

Re: [Spice-devel] [spice-gtk] Set windows hook only when keyboard is grabbed

2017-05-16 Thread Snir Sheriber
Hi On 05/16/2017 10:57 AM, Pavel Grunt wrote: Hi Snir, On Mon, 2017-05-15 at 19:02 +0300, Snir Sheriber wrote: The keyboard events hook should be set only if keyboard is grabbed otherwise the hook won't behave as expected, e.g alt-tab may cause duplicate event in the windows manager and not r

Re: [Spice-devel] [RFC PATCH 02/15] stream-device: Add device to handle streaming

2017-05-16 Thread Frediano Ziglio
> > On Wed, 2017-04-19 at 16:31 +0100, Frediano Ziglio wrote: > > Add a stub device in guest. > > The aim of this device is make 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 ca

Re: [Spice-devel] [spice-gtk] Set windows hook only when keyboard is grabbed

2017-05-16 Thread Pavel Grunt
Hi Snir, On Mon, 2017-05-15 at 19:02 +0300, Snir Sheriber wrote: > The keyboard events hook should be set only if keyboard is > grabbed otherwise the hook won't behave as expected, e.g alt-tab > may cause duplicate event in the windows manager and not releasing > the alt after key was released Gr

Re: [Spice-devel] [PATCH spice-gtk] doc: Rename argument to match docstring

2017-05-16 Thread Frediano Ziglio
> > Otherwise it appears in undocumented symbols. > > Fixup to f076dd11ce4c83b09350e372307c23c486905d34 Acked-by: Frediano Ziglio > --- > src/usb-device-manager.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/usb-device-manager.h b/src/usb-device-manager.h > in

[Spice-devel] [PATCH spice-gtk] doc: Rename argument to match docstring

2017-05-16 Thread Pavel Grunt
Otherwise it appears in undocumented symbols. Fixup to f076dd11ce4c83b09350e372307c23c486905d34 --- src/usb-device-manager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb-device-manager.h b/src/usb-device-manager.h index dae1d49..41f20d8 100644 --- a/src/usb-device-m