[Spice-devel] [PATCH spice-server] event loop: improve implementation of watches

2019-06-19 Thread Frediano Ziglio
Avoid having to destroy and create a new GSource every time we change event mask. Interfaces required for this patch are available since GLib 2.36. on Windows GPollFD::fd can be an HANDLE but not a socket. Signed-off-by: Frediano Ziglio --- server/event-loop.c | 97 ++

Re: [Spice-devel] [PATCH spice-gtk v2 1/5] gio-pipe: fix NULL pointer dereferencing

2019-06-19 Thread Frediano Ziglio
> > In pipe_output_stream_is_writable, if the peer is already gone, > peer_closed is set to TRUE and in this case, peer->read should not be > accessed > as peer is NULL. > > Otherwise, the following sequence of calls (simplified) would trigger a > segfault: > > spice_make_pipe(p1, p2); >

[Spice-devel] [PATCH spice-gtk v2 5/5] webdav: don't warn on cancel

2019-06-19 Thread Jakub Janků
The IO operation is cancelled on channel dispose and it is not an error, so silence the warnings. Signed-off-by: Jakub Janků --- src/channel-webdav.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/channel-webdav.c b/src/channel-webdav.c index a8cdcbc..f5a38a

[Spice-devel] [PATCH spice-gtk v2 4/5] webdav: remove client on empty message

2019-06-19 Thread Jakub Janků
Message with no data from spice-webdav daemon means the client disconnected. In this case, the client connection to phodav should be closed as well. This can happen e.g. when file transfer gets cancelled. Also, while we're at it, reorder the code a bit. Signed-off-by: Jakub Janků --- src/chan

[Spice-devel] [PATCH spice-gtk v2 1/5] gio-pipe: fix NULL pointer dereferencing

2019-06-19 Thread Jakub Janků
In pipe_output_stream_is_writable, if the peer is already gone, peer_closed is set to TRUE and in this case, peer->read should not be accessed as peer is NULL. Otherwise, the following sequence of calls (simplified) would trigger a segfault: spice_make_pipe(p1, p2); g_output_stream_write

[Spice-devel] [PATCH spice-gtk v2 2/5] vmcstream: finish task immediately when reading 0 bytes

2019-06-19 Thread Jakub Janků
The current implementation finishes it only after new data arrives from the channel (or after it is cancelled). Signed-off-by: Jakub Janků --- src/vmcstream.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/vmcstream.c b/src/vmcstream.c index 86c949a..b6f6d1a 100644 --- a/src/vmcstr

[Spice-devel] [PATCH spice-gtk v2 3/5] webdav: don't start client on empty message

2019-06-19 Thread Jakub Janků
If the client on the remote side disconnects, spice-webdav daemon sends a message with no data. However, if the phodav server already closed the client connection, client lookup fails and we open a new connection to phodav, but don't write anything to it - this should not happen, so in such case,

Re: [Spice-devel] [PATCH spice-gtk 4/5] webdav: remove client on empty message

2019-06-19 Thread Jakub Janku
Hi, On Wed, Jun 19, 2019 at 11:59 AM Frediano Ziglio wrote: > > > > > Message with no data from spice-webdav daemon means > > the client disconnected. > > > > In this case, the client connection to phodav > > should be closed as well. > > > > This can happen e.g. when file transfer gets cancelled

Re: [Spice-devel] [PATCH spice-gtk] usb-device-manager: Define _SpiceUsbDevice instead of SpiceUsbDeviceInfo

2019-06-19 Thread Frediano Ziglio
ping 2 > > ping > > > > > SpiceUsbDevice* was converted to SpiceUsbDeviceInfo* as _SpiceUsbDevice > > was never defines. Define instead the structure to avoid useless > > casts. > > > > Signed-off-by: Frediano Ziglio > > --- > > src/usb-device-manager.c | 59 ++---

Re: [Spice-devel] [PATCH spice-server v2 1/2] char-device: Don't use RedClient API

2019-06-19 Thread Frediano Ziglio
ping the series > > RedClient was an opaque structure for RedCharDevice. > It started to be used when RedsState started to contain all > the global state. > Make it opaque again using a new RedCharDeviceClientOpaque. > The RedCharDeviceClientOpaque define in the header allows users > of the class

Re: [Spice-devel] [PATCH spice-server] red-parse-qxl: Reset mask attributes if brush image is missing

2019-06-19 Thread Frediano Ziglio
ping 2 > > ping > > > > > The attributes in this case are not used to apply the mask. > > Doing so avoid sending garbage from the guest which usually > > don't initialise the memory in case the mask is missing. > > Guest should have cleared these bytes by its own however doing so > > on the ser

Re: [Spice-devel] [PATCH spice-protocol 3/3] qxl_dev: Move QXLReleaseInfoExt out of start/end-packed.h

2019-06-19 Thread Frediano Ziglio
ping 4 > > ping 3 > > > > > ping > > > > > > > > ping > > > > > > > > > > > This structure is not declares as SPICE_ATTR_PACKED resulting it > > > > as aligned and no packed using GCC (no MingW). > > > > This structure is only packed under MingW or Microsoft compilers. > > > > This structur

Re: [Spice-devel] [PATCH spice-protocol 2/3] qxl_dev: Fix alignment for QXLReleaseInfo

2019-06-19 Thread Frediano Ziglio
ping 4 > > ping 3 > > > > > ping > > > > > > > > ping > > > > > > > > > > > Do not declare the structure as aligned. > > > > The start/end-packed.h headers affects only MingW or Microsoft > > > > compilers. To have unaligned structure with GCC compiler you have > > > > to use SPICE_ATTR_PAC

Re: [Spice-devel] [PATCH spice-gtk 0/4] Check distribution with CI

2019-06-19 Thread Frediano Ziglio
ping 3 > > ping > > > > > ping the series > > > > > > > > Make sure we can build distribution. > > > Some small updates also to fix some minor issues. > > > > > > CI results at > > > https://gitlab.freedesktop.org/fziglio/spice-gtk/pipelines/37744 > > > > > > Frediano Ziglio (4): > > > ci

Re: [Spice-devel] [PATCH spice-gtk 3/5] webdav: don't start client on empty message

2019-06-19 Thread Frediano Ziglio
> > If the client on the remote side disconnects, > spice-webdav daemon sends a message with no data. > > However, if the phodav server already closed > the client connection, client lookup fails and > we open a new connection to phodav, but don't write > anything to it - this should not happen,

Re: [Spice-devel] [PATCH spice-gtk 4/5] webdav: remove client on empty message

2019-06-19 Thread Frediano Ziglio
> > Message with no data from spice-webdav daemon means > the client disconnected. > > In this case, the client connection to phodav > should be closed as well. > > This can happen e.g. when file transfer gets cancelled. > > Signed-off-by: Jakub Janků > --- > src/channel-webdav.c | 4 ++-- >

Re: [Spice-devel] [PATCH spice-server 3/3] jpeg: Support big endian machines

2019-06-19 Thread Uri Lublin
On 6/3/19 2:22 PM, Frediano Ziglio wrote: Signed-off-by: Frediano Ziglio --- server/jpeg-encoder.c | 7 +++ server/mjpeg-encoder.c | 21 +++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/server/jpeg-encoder.c b/server/jpeg-encoder.c index 269ed8aa7..

Re: [Spice-devel] [PATCH spice-server 2/3] Remove a warning on MIPS machine

2019-06-19 Thread Uri Lublin
On 6/18/19 8:03 PM, Frediano Ziglio wrote: On 6/3/19 2:22 PM, Frediano Ziglio wrote: The formula is here to make sure glyph is aligned to 4 bytes so tell to the compiler to avoid a warning. What's the warning ? Trying to reproduce but the updated environment it's slow like hell (it's more