[Spice-devel] [PATCH spice-server] Use new GObject define macros with private

2019-02-06 Thread Eduardo Lima (Etrunko)
G_ADD_PRIVATE was added in 2.38 and older functions are getting deprecated: https://gitlab.gnome.org/GNOME/glib/merge_requests/7/commits Signed-off-by: Eduardo Lima (Etrunko) --- server/char-device.c | 4 +--- server/common-graphics-channel.c | 23 ++- server/cur

Re: [Spice-devel] [PATCH spice-common] Obsolete Glib cleanup

2019-02-06 Thread Eduardo Lima (Etrunko)
On 2/6/19 11:32 AM, Frediano Ziglio wrote: > We require at least GLib 2.38, remove code and check to > support earlier versions. > > Signed-off-by: Frediano Ziglio > --- > common/log.c | 8 > tests/test-logging.c | 4 > 2 files changed, 12 deletions(-) > > diff --git a/com

[Spice-devel] [PATCH spice-server v4 17/20] tests: Exclude tests that cannot work on Windows

2019-02-06 Thread Frediano Ziglio
test-stream test is passing file descriptor using Unix socket. test-stat-file needs some porting work of mmap feature. Signed-off-by: Frediano Ziglio Reviewed-by: Marc-André Lureau --- server/tests/Makefile.am | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/t

[Spice-devel] [PATCH spice-server v4 16/20] dispatcher: Port to Windows

2019-02-06 Thread Frediano Ziglio
Replace poll call with select. As socket is set to non-blocking we must support it so if we detect an EAGAIN error wait for data. Signed-off-by: Frediano Ziglio --- server/dispatcher.c | 20 1 file changed, 20 insertions(+) diff --git a/server/dispatcher.c b/server/dispatch

[Spice-devel] [PATCH spice-server v4 20/20] Add some notes for the Windows port

2019-02-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- README.Windows | 18 ++ 1 file changed, 18 insertions(+) create mode 100644 README.Windows diff --git a/README.Windows b/README.Windows new file mode 100644 index ..a953813d --- /dev/null +++ b/README.Windows @@ -0,0 +1,18 @@ +SPICE ser

[Spice-devel] [PATCH spice-server v4 06/20] test-stat: Adjust delay checks

2019-02-06 Thread Frediano Ziglio
usleep under Windows does not seem to have the required precision. Use milliseconds and adjust check times according. Signed-off-by: Frediano Ziglio --- server/tests/stat-test.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/tests/stat-test.c b/server/tes

[Spice-devel] [PATCH spice-server v4 13/20] test-leaks: Use socket compatibility layer

2019-02-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/tests/test-leaks.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/tests/test-leaks.c b/server/tests/test-leaks.c index 64130c22..be9fe2d2 100644 --- a/server/tests/test-leaks.c +++ b/server/tests/test-leaks.c @@ -35,6 +35,

[Spice-devel] [PATCH spice-server v4 12/20] dispatcher: Use socket compatibility layer

2019-02-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/dispatcher.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/dispatcher.c b/server/dispatcher.c index 3e27f2c2..657bfc7d 100644 --- a/server/dispatcher.c +++ b/server/dispatcher.c @@ -109,8 +109,8 @@ dispatcher_finalize(

[Spice-devel] [PATCH spice-server v4 10/20] reds: Use socket compatibility layer

2019-02-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-common.h | 1 + server/reds.c | 11 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/red-common.h b/server/red-common.h index 181ed283..6b5d0b2e 100644 --- a/server/red-common.h +++ b/server/red-common.h @@ -35,

[Spice-devel] [PATCH spice-server v4 02/20] build: Detect Windows build and change some definitions

2019-02-06 Thread Frediano Ziglio
Windows needs some specific setting to use network. Signed-off-by: Frediano Ziglio --- configure.ac | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 604a41b2..f8b41f37 100644 --- a/configure.ac +++ b/configure.ac @@ -68,6

[Spice-devel] [PATCH spice-server v4 19/20] Disable recording filtering for Windows

2019-02-06 Thread Frediano Ziglio
Although this feature can be ported to Windows doing so would require the usage of g_spawn_async_with_fds, which is only available in GLib 2.58 or some specific Win32 code. Signed-off-by: Frediano Ziglio --- server/red-record-qxl.c| 7 +++ server/tests/test-record.c | 7 +-- 2 files

[Spice-devel] [PATCH spice-server v4 18/20] red-stream: Fix SSL connection for Windows

2019-02-06 Thread Frediano Ziglio
Set correctly errno to make callers handle correctly encrypted traffic. Signed-off-by: Frediano Ziglio --- server/red-stream.c | 29 + 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/server/red-stream.c b/server/red-stream.c index 3641f0ce..d9e32845 100

[Spice-devel] [PATCH spice-server v4 15/20] windows: Disable code not working on Windows

2019-02-06 Thread Frediano Ziglio
- global signals; - CLOEXEC flag; - mmap and statistics; - IPTOS_LOWDELAY flag; - Unix sockets; - sharing file descriptors through Unix sockets; - TCP_CORK flag. Signed-off-by: Frediano Ziglio --- server/red-channel-client.c | 2 ++ server/red-stream.c | 11 ++- server/r

[Spice-devel] [PATCH spice-server v4 11/20] red-stream: Use socket compatibility layer

2019-02-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red-stream.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/red-stream.c b/server/red-stream.c index 55ad170f..8f36d1d4 100644 --- a/server/red-stream.c +++ b/server/red-stream.c @@ -114,7 +114,7 @@ static int socket_se

[Spice-devel] [PATCH spice-server v4 07/20] sys-socket: Introduce some utility to make sockets more portable

2019-02-06 Thread Frediano Ziglio
Between Unix and Windows socket are quite different: - on Windows sockets have a different namespace from C file descriptors so you can't use read/write/close or similar functions; - errors are not stored in errno but you must be read/write the errors with specific function; - sometimes sockets

[Spice-devel] [PATCH spice-server v4 14/20] test-channel: Use socket compatibility layer

2019-02-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/tests/test-channel.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/tests/test-channel.c b/server/tests/test-channel.c index ec0fdceb..a634a662 100644 --- a/server/tests/test-channel.c +++ b/server/tests/test-channel.c

[Spice-devel] [PATCH spice-server v4 03/20] Avoids %m in formatting for Windows

2019-02-06 Thread Frediano Ziglio
Not supported, %m is a GNU extension of sscanf. Signed-off-by: Frediano Ziglio --- server/reds.c | 25 - 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/server/reds.c b/server/reds.c index d3f73d8e..8c1c10dc 100644 --- a/server/reds.c +++ b/server/reds.c @

[Spice-devel] [PATCH spice-server v4 09/20] net-utils: Use socket compatibility layer

2019-02-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/net-utils.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/server/net-utils.c b/server/net-utils.c index 802509a4..ad66a328 100644 --- a/server/net-utils.c +++ b/server/net-utils.c @@ -35,6 +35,7 @@ #include #include "net-utils.h" +

[Spice-devel] [PATCH spice-server v4 08/20] sys-socket: Add socket_newpair utility

2019-02-06 Thread Frediano Ziglio
Allows to easier port socketpair. Windows does not have this function, we need to create a pair using 2 internet sockets and connecting one to the other. Signed-off-by: Frediano Ziglio --- server/sys-socket.c | 75 + server/sys-socket.h | 3 ++ 2 file

[Spice-devel] [PATCH spice-server v4 04/20] windows: Undefine some conflicting preprocessor macros

2019-02-06 Thread Frediano Ziglio
"interface" and "MAX_MONITORS" are defined in some Windows system headers causing garbage code to be fed to the compiler. Signed-off-by: Frediano Ziglio --- server/red-qxl.c | 4 server/reds.c| 6 ++ 2 files changed, 10 insertions(+) diff --git a/server/red-qxl.c b/server/red-qxl.c

[Spice-devel] [PATCH spice-server v4 05/20] tests: Provide alarm replacement for Windows

2019-02-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio Reviewed-by: Marc-André Lureau --- server/tests/Makefile.am | 2 + server/tests/test-channel.c | 1 + server/tests/test-loop.c | 1 + server/tests/test-stream-device.c | 1 + server/tests/win-alarm.c | 65 +++

[Spice-devel] [PATCH spice-server v4 01/20] Use proper format strings for spice_log

2019-02-06 Thread Frediano Ziglio
Formatting string should be compatible with GLib. GLib uses formatting types compatible with GNU. For Linux this is not an issue as both systems (like a printf) and GLib one uses the same formatting type. However on Windows they differs potentially causing issues. This is also make worse as GLib 2

[Spice-devel] [PATCH spice-server v4 00/20] Port SPICE server to Windows

2019-02-06 Thread Frediano Ziglio
Windows support is useful to use with Qemu under Windows as host or to implement servers like Xspice. Mainly SPICE server uses lot of libraries to expose a TCP protocol. As TCP is implemented with socket library which is quite portable was not that hard to port. Beside some minor feature (see REAME

Re: [Spice-devel] [spice-server] doc: Document G_MESSAGES_DEBUG use

2019-02-06 Thread Frediano Ziglio
> Explain how to get more verbose logs out of spice-server > > Signed-off-by: Christophe Fergeau > --- > docs/manual/manual.txt | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/docs/manual/manual.txt b/docs/manual/manual.txt > index 99f6a5c84..312df8c5c 100644 > --- a/docs/man

[Spice-devel] [PATCH spice-common] Obsolete Glib cleanup

2019-02-06 Thread Frediano Ziglio
We require at least GLib 2.38, remove code and check to support earlier versions. Signed-off-by: Frediano Ziglio --- common/log.c | 8 tests/test-logging.c | 4 2 files changed, 12 deletions(-) diff --git a/common/log.c b/common/log.c index f9cdd60..054fd7f 100644 --- a/co

Re: [Spice-devel] [PATCH spice-common 1/2] log: remove deprecated SPICE_ABORT_LEVEL support

2019-02-06 Thread Frediano Ziglio
> On Tue, Jan 29, 2019 at 10:49:23AM +, Frediano Ziglio wrote: > > This feature was marked obsolete by efd1d3cb4d8eee more than > > three years ago. > > > > Signed-off-by: Frediano Ziglio > > --- > > common/log.c | 30 +- > > tests/test-logging.c | 39 +---

Re: [Spice-devel] [spice-server v2] ssl: Dump OpenSSL error stack on errors

2019-02-06 Thread Uri Lublin
On 1/14/19 12:59 PM, Christophe Fergeau wrote: Bugs such as https://bugzilla.redhat.com/show_bug.cgi?id=1651882 can be quite tricky to figure out without the detailed OpenSSL error. This commit adds a detailed dump of the OpenSSL error stack when an OpenSSL failure happens. In the bug above, thi

[Spice-devel] [spice-server] doc: Document G_MESSAGES_DEBUG use

2019-02-06 Thread Christophe Fergeau
Explain how to get more verbose logs out of spice-server Signed-off-by: Christophe Fergeau --- docs/manual/manual.txt | 9 + 1 file changed, 9 insertions(+) diff --git a/docs/manual/manual.txt b/docs/manual/manual.txt index 99f6a5c84..312df8c5c 100644 --- a/docs/manual/manual.txt +++ b/

Re: [Spice-devel] [PATCH spice-common 2/2] log: remove deprecated SPICE_DEBUG_LEVEL support

2019-02-06 Thread Christophe Fergeau
On Tue, Jan 29, 2019 at 10:49:24AM +, Frediano Ziglio wrote: > SPICE_CONSTRUCTOR_FUNC(spice_log_init) > { > - > -spice_log_set_debug_level(); > -if (glib_debug_level != INT_MAX) { > -/* If SPICE_DEBUG_LEVEL is set, we need a custom handler, which is > - * going to brea

Re: [Spice-devel] [PATCH spice-common 1/2] log: remove deprecated SPICE_ABORT_LEVEL support

2019-02-06 Thread Christophe Fergeau
On Tue, Jan 29, 2019 at 10:49:23AM +, Frediano Ziglio wrote: > This feature was marked obsolete by efd1d3cb4d8eee more than > three years ago. > > Signed-off-by: Frediano Ziglio > --- > common/log.c | 30 +- > tests/test-logging.c | 39 +---

Re: [Spice-devel] [PATCH] spec: call semanage in posttrans not in post

2019-02-06 Thread Christophe Fergeau
On Tue, Feb 05, 2019 at 01:24:38PM -0500, Frediano Ziglio wrote: > > On Tue, Feb 05, 2019 at 09:30:39AM -0500, Frediano Ziglio wrote: > > > > > > > > It can happen that selinux-policy (targeted) is installed only after > > > > spice-streaming-agent (upon system installation). In that case > > > >

Re: [Spice-devel] [spice-gtk] clipboard: don't request targets without owner on X11

2019-02-06 Thread Victor Toso
On Sun, 2019-01-27 at 18:14 +0100, jjanku at redhat.com wrote: > On X11, if the owner in GdkEventOwnerChange is set to NULL, > it means there's no data in the clipboard, so it's pointless to > request targets as the request will fail anyway. > > On Wayland, owner is always NULL, so don't do anythi