[Spice-devel] [PATCH v4 x11spice 3/3] Bug fix: a listen specification from the config file was ignored

2019-07-23 Thread Jeremy White
Signed-off-by: Jeremy White --- src/options.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/options.c b/src/options.c index 6620b853..64e6ac95 100644 --- a/src/options.c +++ b/src/options.c @@ -327,7 +327,9 @@ int options_parse_arguments(int argc, char *argv[], optio

[Spice-devel] [PATCH v4 x11spice 2/3] Simplify the expression of option handling.

2019-07-23 Thread Jeremy White
This fixes a bug with --config= handling. Add expanded test code courtesy of Frediano Ziglio . Signed-off-by: Jeremy White --- src/main.c| 8 +++-- src/options.c | 93 ++- src/options.h | 1 - 3 files changed, 83 insertions(+), 19 deletions(

[Spice-devel] [PATCH v4 x11spice 1/3] Convert to the use of glib memory routines in options.c.

2019-07-23 Thread Jeremy White
Also be sure that when replacing an option string, we free it first, and free the SSL and password_file option fields. Signed-off-by: Jeremy White --- v4: Consolidate a few patches into one Use a suggestion from Freddy to free memory on replace Use that to simplify the expression of ar

[Spice-devel] [PATCH spice-server v2] red-parse-qxl: Fix QUIC images from QXL

2019-07-23 Thread Frediano Ziglio
The decoding is wrong, the Red and QXL structures are different so code is not doing what is expected. red-parse-qxl translate from QXL to Red structures, red-record-qxl saves Red structure to file, red-replay-qxl is supposed to read from file into QXL directly. If a Quic image is stored inside QX

Re: [Spice-devel] [PATCH v2 x11spice 3/4] Bug fix: support --config= semantics.

2019-07-23 Thread Jeremy White
On 7/23/19 11:27 AM, Frediano Ziglio wrote: Instead of trying to parse argv ourselves, just reuse getopt_long_only. Signed-off-by: Jeremy White This patch looks a bit long compared to the job is doing. What is the expected behaviour mixing --config and other options? It looks like the config

Re: [Spice-devel] [PATCH v2 x11spice 3/4] Bug fix: support --config= semantics.

2019-07-23 Thread Frediano Ziglio
> > Instead of trying to parse argv ourselves, just reuse getopt_long_only. > > Signed-off-by: Jeremy White This patch looks a bit long compared to the job is doing. What is the expected behaviour mixing --config and other options? It looks like the configuration file should be always read firs

[Spice-devel] [spice-gtk v3 4/4] usb-redir: use g_thread_try_new instead of g_thread_new

2019-07-23 Thread Yuri Benditovich
Newer API (glib 2.32) is safe, in case of error it does not abort the process and returns error information. Signed-off-by: Yuri Benditovich --- src/usb-backend.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index 7c9b544..

[Spice-devel] [spice-gtk v3 1/4] usb-redir: unify device hotplug/unplug for Windows and Linux

2019-07-23 Thread Yuri Benditovich
Remove Windows-specific part of hotplug detection from usb-device-manager and win-usb-dev and place it into USB backend module. Connect the hotplug/unplug detection in Windows to the same callbacks already used in Linux. This removes significant part of Windows-specific code and simpifies things. N

[Spice-devel] [spice-gtk v3 0/4] usb-redir: unification of Linux and Windows code

2019-07-23 Thread Yuri Benditovich
This series is dedicated to unification of Linux Windows flows in usb-device-manager. It moves differences related to libusb to USB backend module and simplifies implementation of procedures related to USB redirection. Changes from v2: cosmetic changes Yuri Benditovich (4): usb-redir: unify dev

[Spice-devel] [spice-gtk v3 3/4] usb-redir: move USB events handling to USB backend

2019-07-23 Thread Yuri Benditovich
Before this commit: usb-device-manager starts thread for handling libusb events: on Linux - from the beginning (as it is needed for hotplug callbacks), on Windows - starts it on first redirection and stops when there are no redirections (it can't keep the thread when there are no redirections as wi

[Spice-devel] [spice-gtk v3 2/4] usb-redir: pass GError to hotplug registration procedure

2019-07-23 Thread Yuri Benditovich
In case of possible error the procedure of hotplug registration does not return error information, just issues warning to the stderr, so the reason of the problem, if any, is not visible. Current commit adds GError parameter to the procedure to return the error details conventionally. Signed-off-b

Re: [Spice-devel] [PATCH v2 x11spice 1/4] Convert to the use of glib memory routines in options.c.

2019-07-23 Thread Jeremy White
On 7/22/19 5:16 AM, Frediano Ziglio wrote: Signed-off-by: Jeremy White I didn't expected you would change everything :-) :-). Well, I appreciate the review, so when the suggestions are easy, I try to be responsive. -p = options->spice_password = malloc(options->generate_password

[Spice-devel] [PATCH v3 x11spice 1/4] Convert to the use of glib memory routines in options.c.

2019-07-23 Thread Jeremy White
Signed-off-by: Jeremy White --- v3: Updates only 1/4; don't check g_malloc return. --- src/options.c | 46 -- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/src/options.c b/src/options.c index b7f487c5..e9d33f24 100644 --- a/src/options

Re: [Spice-devel] [spice-gtk v2 0/9] usb-redir: unification of Linux and Windows code

2019-07-23 Thread Victor Toso
Hi, Thanks for the split, the difference for review is like the difference between day and night. 1/9 is already merged but I'll merge 2/9 to 5/9 so it'll reduce the amount of patches to send. Cheers, On Tue, Jul 23, 2019 at 10:26:59AM +0300, Yuri Benditovich wrote: > This series is dedicated t

Re: [Spice-devel] [spice-gtk v2 9/9] usb-redir: use g_thread_try_new instead of g_thread_new

2019-07-23 Thread Victor Toso
Hi, On Tue, Jul 23, 2019 at 10:27:08AM +0300, Yuri Benditovich wrote: > Newer API (glib 2.32) is safe, in case of error it does not > abort the process and returns error information. > > Signed-off-by: Yuri Benditovich > --- > src/usb-backend.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 d

Re: [Spice-devel] [spice-gtk v2 8/9] usb-redir: move USB events handling to USB backend

2019-07-23 Thread Victor Toso
On Tue, Jul 23, 2019 at 10:27:07AM +0300, Yuri Benditovich wrote: > Before this commit: > usb-device-manager starts thread for handling libusb events: > on Linux - from the beginning (as it is needed for hotplug > callbacks), on Windows - starts it on first redirection and > stops when there are no

Re: [Spice-devel] [spice-gtk v2 7/9] usb-redir: pass GError to hotplug registration procedure

2019-07-23 Thread Victor Toso
Hi, On Tue, Jul 23, 2019 at 10:27:06AM +0300, Yuri Benditovich wrote: > In case of possible error the procedure of hotplug > registration does not return error information, just > issues warning to the stderr, so the reason of the problem, > if any, is not visible. Current commit adds GError param

Re: [Spice-devel] [spice-gtk v2 6/9] usb-redir: unify device hotplug/unplug for Windows and Linux

2019-07-23 Thread Victor Toso
Hi, On Tue, Jul 23, 2019 at 10:27:05AM +0300, Yuri Benditovich wrote: > Remove Windows-specific part of hotplug detection from > usb-device-manager and win-usb-dev and place it into > USB backend module. Connect the hotplug/unplug detection > in Windows to the same callbacks already used in Linux.

Re: [Spice-devel] [spice-gtk v2 5/9] usb-redir: cosmetic changes in hotplug_callback

2019-07-23 Thread Victor Toso
Hi, On Tue, Jul 23, 2019 at 10:40:47AM +0300, Yuri Benditovich wrote: > Sorry, this is a typo in the comment - should be unexpected condition, > i.e. exactly the bug in the code Yes, this is minor and can be fixed before pushing. From 1/9 to 5/9, Acked-by: Victor Toso > On Tue, Jul 23, 2019 at

[Spice-devel] [PATCH] drm/qxl: Use dev_get_drvdata where possible

2019-07-23 Thread Chuhong Yuan
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan --- drivers/gpu/drm/qxl/qxl_drv.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index f33

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

2019-07-23 Thread Frediano Ziglio
> > Hi, > > On Wed, Jun 19, 2019 at 04:56:41PM +0100, Frediano Ziglio wrote: > > 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

Re: [Spice-devel] [PATCH spice-gtk 2/2] spice-widget-egl: Declare and initialise "tex" and "verts" shortly

2019-07-23 Thread Victor Toso
Hi, On Mon, Jul 22, 2019 at 12:26:00PM +0100, Frediano Ziglio wrote: > Just syntax change. > Reduce code to initialise these matrices. Yes, looks nicer. Acked-by: Victor Toso > > Signed-off-by: Frediano Ziglio > --- > src/spice-widget-egl.c | 40 +--- > 1

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

2019-07-23 Thread Victor Toso
Hi, On Wed, Jun 19, 2019 at 04:56:41PM +0100, Frediano Ziglio wrote: > 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

[Spice-devel] [ANNOUNCE] libcacard 2.7.0 release

2019-07-23 Thread Jakub Jelen
Hello, I just released libcacard 2.7.0. It is based on recent work to improve compatibility with Windows guests (particularly ActivClient drivers) for smart card sharing using several methods: * Implementation of Microsoft PnP applet used for card detection in Windows * Implementation of API to

[Spice-devel] [PATCH vd_agent_linux] x11: Change check to make code scanners not giving warning

2019-07-23 Thread Frediano Ziglio
Some code scanners (both Coverity and clang one) report that prev_sel/prev_cond could be unreferenced while NULL. Change condition to make clear a NULL pointer is not used. Signed-off-by: Frediano Ziglio --- src/vdagent/x11.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --gi

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

2019-07-23 Thread Frediano Ziglio
ping > > ping > > > > > 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 > > --- > >

[Spice-devel] [PATCH spice-server] Use (u)intptr_t for virtual addresses

2019-07-23 Thread Frediano Ziglio
On LLP64 platforms (like Windows) a virtual address cannot be represented by a "unsigned long" type, so use uintptr_t which is defined as a integral type large like a pointer. "address_delta" is a difference of pointers so use same type size. Signed-off-by: Frediano Ziglio --- server/memslot.c

[Spice-devel] [PATCH spice-server 2/2] replay: Remove some leak and a FIXME

2019-07-23 Thread Frediano Ziglio
Threads are joined by spice_server_destroy, just need to release last resources. Signed-off-by: Frediano Ziglio --- server/tests/replay.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/tests/replay.c b/server/tests/replay.c index 992f26d63..44f244457 100644 --- a

[Spice-devel] [PATCH spice-server 1/2] replay: Remove some goto statement

2019-07-23 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/tests/replay.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/server/tests/replay.c b/server/tests/replay.c index e3ef7bf15..992f26d63 100644 --- a/server/tests/replay.c +++ b/server/tests/replay.c @@ -116,7 +116,7

[Spice-devel] [PATCH spice-server] red-replay-qxl: Fix replay on 32 bit systems

2019-07-23 Thread Frediano Ziglio
On 32 systems pointers are 32 bit while QXLPHYSICAL is always 64 bit. Using pointer -> intptr_t -> QXLPHYSICAL conversion cause pointers to have higher 32 bit set to 1 if the address is >= 0x8000. This is possible depending on address space. The QXLPHYSICAL is split in 3 sections: - slot ID; -

Re: [Spice-devel] [spice-gtk v2 5/9] usb-redir: cosmetic changes in hotplug_callback

2019-07-23 Thread Yuri Benditovich
Sorry, this is a typo in the comment - should be unexpected condition, i.e. exactly the bug in the code On Tue, Jul 23, 2019 at 10:33 AM Frediano Ziglio wrote: > > > > > Unify parameter name for libusb_device. > > Use g_return_val_if_fail for expected condition. > > See > https://developer.gnome

Re: [Spice-devel] [spice-gtk v2 5/9] usb-redir: cosmetic changes in hotplug_callback

2019-07-23 Thread Frediano Ziglio
> > Unify parameter name for libusb_device. > Use g_return_val_if_fail for expected condition. See https://developer.gnome.org/glib/stable/glib-Warnings-and-Assertions.html#g-return-val-if-fail g_return_val_if_fail represents a bug in the code, not an "expected condition". > Remove redundant ca

[Spice-devel] [spice-gtk v2 9/9] usb-redir: use g_thread_try_new instead of g_thread_new

2019-07-23 Thread Yuri Benditovich
Newer API (glib 2.32) is safe, in case of error it does not abort the process and returns error information. Signed-off-by: Yuri Benditovich --- src/usb-backend.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index bbd3b67..272d72

[Spice-devel] [spice-gtk v2 5/9] usb-redir: cosmetic changes in hotplug_callback

2019-07-23 Thread Yuri Benditovich
Unify parameter name for libusb_device. Use g_return_val_if_fail for expected condition. Remove redundant casting. Signed-off-by: Yuri Benditovich --- src/usb-backend.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/usb-backend.c b/src/usb-bac

[Spice-devel] [spice-gtk v2 3/9] usb-redir: split fill_usb_info procedure for further reuse

2019-07-23 Thread Yuri Benditovich
Utility procedure get_usb_device_info_from_libusb_device will be reused later. Signed-off-by: Yuri Benditovich --- src/usb-backend.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index a33cbe6..c2268e3 100644 -

[Spice-devel] [spice-gtk v2 0/9] usb-redir: unification of Linux and Windows code

2019-07-23 Thread Yuri Benditovich
This series is dedicated to unification of Linux Windows flows in usb-device-manager. It moves differences related to libusb to USB backend module and simplifies implementation of procedures related to USB redirection. Yuri Benditovich (9): build: require minimal libusb version 1.0.21 usb-redi

[Spice-devel] [spice-gtk v2 7/9] usb-redir: pass GError to hotplug registration procedure

2019-07-23 Thread Yuri Benditovich
In case of possible error the procedure of hotplug registration does not return error information, just issues warning to the stderr, so the reason of the problem, if any, is not visible. Current commit adds GError parameter to the procedure to return the error details conventionally. Signed-off-b

[Spice-devel] [spice-gtk v2 1/9] build: require minimal libusb version 1.0.21

2019-07-23 Thread Yuri Benditovich
Previous commit ca641a5b92 uses libusb_interrupt_event_handler which requires newer version of libusb. Signed-off-by: Yuri Benditovich --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 32561ee..54160f9 100644 --- a/meson.build +++

[Spice-devel] [spice-gtk v2 6/9] usb-redir: unify device hotplug/unplug for Windows and Linux

2019-07-23 Thread Yuri Benditovich
Remove Windows-specific part of hotplug detection from usb-device-manager and win-usb-dev and place it into USB backend module. Connect the hotplug/unplug detection in Windows to the same callbacks already used in Linux. This removes significant part of Windows-specific code and simpifies things. N

[Spice-devel] [spice-gtk v2 4/9] usb-redir: change parameter name 'bdev' to 'dev'

2019-07-23 Thread Yuri Benditovich
Unify with other places for better readability. Signed-off-by: Yuri Benditovich --- src/usb-backend.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index c2268e3..53ac430 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -

[Spice-devel] [spice-gtk v2 8/9] usb-redir: move USB events handling to USB backend

2019-07-23 Thread Yuri Benditovich
Before this commit: usb-device-manager starts thread for handling libusb events: on Linux - from the beginning (as it is needed for hotplug callbacks), on Windows - starts it on first redirection and stops when there are no redirections (it can't keep the thread when there are no redirections as wi

[Spice-devel] [spice-gtk v2 2/9] usb-redir: move 3 static procedures up for further reuse

2019-07-23 Thread Yuri Benditovich
Procedures moved without changes, they will be reused in later commits. Signed-off-by: Yuri Benditovich --- src/usb-backend.c | 110 +++--- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index a2c502d.

Re: [Spice-devel] [PATCH phodav 1/2] spice: read_thread: return number of read bytes on EOF

2019-07-23 Thread Victor Toso
Hi, On Mon, Jul 22, 2019 at 03:22:10PM +0200, Jakub Janků wrote: > We already check with each input_stream_read_thread_finish() > whether the count of the read bytes matches the requested one. > > Also, this is the way GLib handles it. > > Signed-off-by: Jakub Janků > --- > > https://gitlab.gn