Re: [Spice-devel] [PATCH v2 3/4] use QXLState instead of RedDispatcher

2016-03-08 Thread Frediano Ziglio
> > On Thu, 3 Mar 2016, Frediano Ziglio wrote: > [...] > > void red_qxl_init(QXLInstance *qxl) > > { > > -RedDispatcher *red_dispatcher; > > +QXLState *qxl_state; > > RedChannel *channel; > > ClientCbs client_cbs = { NULL, }; > > > > spice_return_if_fail(qxl != NULL); >

Re: [Spice-devel] [PATCH spice-gtk 0/3] Add basic tests for usb-acl-helper

2016-03-08 Thread Marc-André Lureau
Hi - Original Message - > This just adds a few basic tests to verify that we handle the usb-acl helper > properly. The first patch is actually a bugfix for an issue that was > discovered > while writing the tests. > > The second patch provides some infrastructure for the tests. I'm not su

[Spice-devel] [PATCH spice-gtk 3/3] Add tests for usb-acl-helper

2016-03-08 Thread Jonathon Jongsma
--- tests/Makefile.am | 15 ++-- tests/mock-acl-helper.c | 94 +++ tests/usb-acl-helper.c | 197 3 files changed, 301 insertions(+), 5 deletions(-) create mode 100644 tests/mock-acl-helper.c create mode 100644 tests/us

[Spice-devel] [PATCH spice-gtk 1/3] usb-acl-helper: Avoid deadlock when cancelled

2016-03-08 Thread Jonathon Jongsma
cancelled_cb() (which is triggered when the GCancellable's "cancelled" signal is emitted) called spice_usb_acl_helper_close_acl(), which calls spice_usb_acl_helper_cleanup(), which in turn calls g_cancellable_disconnect(). Calling g_cancellable_disconnect() from within a "cancelled" handler results

[Spice-devel] [PATCH spice-gtk 0/3] Add basic tests for usb-acl-helper

2016-03-08 Thread Jonathon Jongsma
This just adds a few basic tests to verify that we handle the usb-acl helper properly. The first patch is actually a bugfix for an issue that was discovered while writing the tests. The second patch provides some infrastructure for the tests. I'm not sure that adding this acl-helper-path property

[Spice-devel] [PATCH spice-gtk 2/3] SpiceUsbAclHelper: add "acl-helper-path" property

2016-03-08 Thread Jonathon Jongsma
This allows you to specify a path to a custom binary that will be spawned by SpiceUsbAclHelper to obtain permission for a particular USB device. This will be used for testing so that we can use a mock acl helper binary that can be manipulated to return arbitary responses. This makes it easier to ve

Re: [Spice-devel] [PATCH v2 3/4] use QXLState instead of RedDispatcher

2016-03-08 Thread Francois Gouget
On Thu, 3 Mar 2016, Frediano Ziglio wrote: [...] > void red_qxl_init(QXLInstance *qxl) > { > -RedDispatcher *red_dispatcher; > +QXLState *qxl_state; > RedChannel *channel; > ClientCbs client_cbs = { NULL, }; > > spice_return_if_fail(qxl != NULL); > -spice_return_if_fa

Re: [Spice-devel] [PATCH spice] Fix dcc_start() regression

2016-03-08 Thread Frediano Ziglio
> > Commit e9ed125d introduced a dead-lock regression by taking twice the > same lock recursively. The previous code checked if a dmabuf was set > without taking the lock, for queuing scanout messages. Since the message > is being processed later on, it make sense to queue and delay until it > is

[Spice-devel] [PATCH spice] Fix dcc_start() regression

2016-03-08 Thread Marc-André Lureau
Commit e9ed125d introduced a dead-lock regression by taking twice the same lock recursively. The previous code checked if a dmabuf was set without taking the lock, for queuing scanout messages. Since the message is being processed later on, it make sense to queue and delay until it is sent to check

[Spice-devel] [PATCH v7 06/14] usbredir: Spawn a different thread for device redirection flow

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik On Windows when using usbdk, opening and closing USB device handle, i.e. calling libusb_open()/libusb_unref_device() can block for a few seconds (3-5 second more specifically on patch author's HW). libusb_open() is called by spice_usbredir_channel_open_device(). libusb_unref

[Spice-devel] [PATCH v7 10/14] usbredir: Disconnect USB device asynchronously

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik Signed-off-by: Kirill Moizik Signed-off-by: Dmitry Fleytman --- src/channel-usbredir.c | 48 +--- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c index 7253ce6..ba9e4a

[Spice-devel] [PATCH v7 13/14] UsbDeviceWidget: Use asynchronous disconnect API

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik Signed-off-by: Kirill Moizik Signed-off-by: Dmitry Fleytman --- src/usb-device-widget.c | 42 +- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c index 56bdeaf..cafaf78 1

[Spice-devel] [PATCH v7 07/14] UsbDeviceManager: Track device redirection operations in progress

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik During device connection, unwanted hotplug events may happen. We need to ignore those therefore we track redirection operations in progress. See also comment to commit "Do not process USB hotplug events while redirection is in progress" that introduces corresponding filtering

[Spice-devel] [PATCH v7 04/14] GUdevClient: Do not process USB hotplug events while redirection is in progress

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik USB redirection flow on Windows includes a number of reset requests issued to the port that hosts the device deing redirected. Each port reset emulates device removal and reinsertion and produces corresponding hotplug events and a number of device list updates on different le

[Spice-devel] [PATCH v7 09/14] UsbDeviceManager: Track device disconnection operations in progress

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik During device disconnection, unwanted hotplug events may happen. We need to ignore those therefore we track disconnection operations in progress. See also comment to commit "Do not process USB hotplug events while redirection is in progress" that introduces corresponding filt

[Spice-devel] [PATCH v7 12/14] UsbDeviceWidget: Consider asynchronous redirection flows

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik Gray out redirection controls while there are asynchronous redirection flows in progress. Signed-off-by: Kirill Moizik Signed-off-by: Dmitry Fleytman --- src/usb-device-widget.c | 38 -- 1 file changed, 20 insertions(+), 18 deletions(-)

[Spice-devel] [PATCH v7 05/14] usbredir: Protect data accessed by asynchronous redirection flows

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik This commit adds locking to ensure thread safety required after start/stop redirection flows moved to separate threads. This is done in preparation to following commits that will introduce actual multithreaded access to corresponding routines. Signed-off-by: Kirill Moizik Si

[Spice-devel] [PATCH v7 14/14] UsbDeviceManager: Deprecate synchronous disconnection method

2016-03-08 Thread Dmitry Fleytman
From: Dmitry Fleytman Asynchronous disconnection should be used instead. Signed-off-by: Dmitry Fleytman --- src/usb-device-manager.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/usb-device-manager.h b/src/usb-device-manager.h index a9a4f7a..6a8d0ac 100644 --- a/src/usb-device-man

[Spice-devel] [PATCH v7 11/14] UsbDeviceWidget: Show info bar during redirection flows

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik Signed-off-by: Kirill Moizik Signed-off-by: Dmitry Fleytman --- src/map-file | 1 + src/usb-device-manager.c | 23 +++ src/usb-device-manager.h | 2 ++ src/usb-device-widget.c | 7 +++ 4 files changed, 33 insertions(+) diff --git a/s

[Spice-devel] [PATCH v7 03/14] win-usb-dev: Track device redirection operations in progress

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik This commit introduces redirecting property of GUdevClient This property indicates when a redirection operation is in progress on a device. It's set back to FALSE once the device is fully redirected to the guest. Signed-off-by: Kirill Moizik Signed-off-by: Dmitry Fleytman

[Spice-devel] [PATCH v7 01/14] win-usb-dev: Fix device (un)plug notification handler

2016-03-08 Thread Dmitry Fleytman
This patch fixes device list change notification handing logic for cases when more than one device being plugged or unplugged simultaneously. The simplest way to reproduce the problematic scenario is (un)plugging of a usb HUB with a few devices inserted. Signed-off-by: Dmitry Fleytman --- src/w

[Spice-devel] [PATCH v7 08/14] UsbDeviceManager: Implement asynchronous disconnect device flow

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik This commit introduces functions for asynchronous disconnection flows. Following commits will make use of those. Thread safety is ensured the same way it was done for connection flow in previous commits. Disconnect logic is protected by the same locks that protect connect/usb

[Spice-devel] [PATCH v7 00/14] Make start and stop usb redirection asynchronous

2016-03-08 Thread Dmitry Fleytman
Changes since v6: - changes and fixes as suggested by Jonathon. Jonathon, thanks for the review. - reworked patch that fixes device list handling in case of multiple device state change - synchronous disconnection method deprecated but left in the public interface Changes since v5: - changes an

[Spice-devel] [PATCH v7 02/14] usbredir: Introduce mutex for device (dis)connection

2016-03-08 Thread Dmitry Fleytman
From: Kirill Moizik This commit introduces channel mutex to allow usage of channel objects in mutithreaded environments. This mutex will be used by future commits to protect thread unsafe usbredir functions and data structures. Signed-off-by: Kirill Moizik Signed-off-by: Dmitry Fleytman ---

Re: [Spice-devel] [PATCH v6 14/14] UsbDeviceManager: Make synchronous disconnect method static

2016-03-08 Thread Dmitry Fleytman
> On 1 Mar 2016, at 22:20 PM, Jonathon Jongsma wrote: > > I apologize for not responding to your questions about deprecation earlier. > > Basically, if you look at spice-channel.h you can see an example of how to > deprecate this function instead of removing it from the API. Basically: > > #if

Re: [Spice-devel] [PATCH v6 13/14] UsbDeviceWidget: Use asynchronous disconnect API

2016-03-08 Thread Dmitry Fleytman
> On 1 Mar 2016, at 22:17 PM, Jonathon Jongsma wrote: > > On Sun, 2016-02-28 at 11:54 +0200, Dmitry Fleytman wrote: >> From: Kirill Moizik >> >> Signed-off-by: Kirill Moizik >> Signed-off-by: Dmitry Fleytman >> --- >> src/usb-device-widget.c | 33 - >> 1 file c

Re: [Spice-devel] [PATCH v6 10/14] usbredir: Disconnect USB device asynchronously

2016-03-08 Thread Dmitry Fleytman
> On 1 Mar 2016, at 21:25 PM, Jonathon Jongsma wrote: > > On Sun, 2016-02-28 at 11:54 +0200, Dmitry Fleytman wrote: >> From: Kirill Moizik >> >> Signed-off-by: Kirill Moizik >> Signed-off-by: Dmitry Fleytman >> --- >> src/channel-usbredir.c | 38 +++--- >> 1 fi

Re: [Spice-devel] [PATCH v6 08/14] UsbDeviceManager: Implement asynchronous disconnect device flow

2016-03-08 Thread Dmitry Fleytman
> On 1 Mar 2016, at 21:14 PM, Jonathon Jongsma wrote: > > As I mentioned in the previous patch, I'd really like this rebased on > Fabiano's > GTask work. I understand that it's annoying to have to rebase this stuff, so > I'm > willing to do it for you if you'd prefer. That would be great, tha

Re: [Spice-devel] [PATCH v6 06/14] usbredir: Spawn a different thread for device redirection flow

2016-03-08 Thread Dmitry Fleytman
> On 1 Mar 2016, at 17:58 PM, Jonathon Jongsma wrote: > > On Sun, 2016-02-28 at 11:54 +0200, Dmitry Fleytman wrote: >> From: Kirill Moizik >> >> On Windows when using usbdk, opening and closing USB device handle, >> i.e. calling libusb_open()/libusb_unref_device() can block for a few >> second

Re: [Spice-devel] [PATCH v6 02/14] usbredir: Introduce mutex for device (dis)connection

2016-03-08 Thread Dmitry Fleytman
> On 1 Mar 2016, at 24:55 AM, Jonathon Jongsma wrote: > > On Sun, 2016-02-28 at 11:54 +0200, Dmitry Fleytman wrote: >> From: Kirill Moizik >> >> This commit introduces channel mutex to allow usage of >> channel objects in mutithreaded environments. >> >> This mutex will be used by future comm

Re: [Spice-devel] [PATCH v6 01/14] win-usb-dev: Fix device (un)plug notification handler

2016-03-08 Thread Dmitry Fleytman
> On 1 Mar 2016, at 24:06 AM, Jonathon Jongsma wrote: > > On Sun, 2016-02-28 at 11:54 +0200, Dmitry Fleytman wrote: >> This patch fixes device list change notification handing >> logic for cases when more than one device being plugged >> or unplugged simultaneously. >> >> The simplest way to re

Re: [Spice-devel] [spice-html5] Fix 2 typos in comments

2016-03-08 Thread Christophe Fergeau
On Tue, Mar 08, 2016 at 11:44:43AM +0100, Pavel Grunt wrote: > Acked-by: Pavel Grunt Thanks, pushed. Christophe signature.asc Description: PGP signature ___ Spice-devel mailing list Spice-devel@lists.freedesktop.org https://lists.freedesktop.org/mail

Re: [Spice-devel] [spice-html5] Fix 2 typos in comments

2016-03-08 Thread Pavel Grunt
Acked-by: Pavel Grunt On Tue, 2016-03-08 at 11:39 +0100, Christophe Fergeau wrote: > --- >  utils.js | 4 ++-- >  1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/utils.js b/utils.js > index 9eb42ff..f1a5748 100644 > --- a/utils.js > +++ b/utils.js > @@ -100,7 +100,7 @@ function h

[Spice-devel] [spice-html5] Fix 2 typos in comments

2016-03-08 Thread Christophe Fergeau
--- utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.js b/utils.js index 9eb42ff..f1a5748 100644 --- a/utils.js +++ b/utils.js @@ -100,7 +100,7 @@ function hexdump_buffer(a) /* ** Co

Re: [Spice-devel] How to adapt keymaps for spice-html5

2016-03-08 Thread Christophe Fergeau
Hey, I experimented a bit with this.. On Mon, Mar 07, 2016 at 02:43:16PM +, Eric Grammatico wrote: > The comments from the js file says: > > * definition of the AT84/MF101/MF102 Keyboard > > I had a look in Google to see a picture of a AT84 Wahou ! Does someone > believe a user will ty

Re: [Spice-devel] [PATCH] vnc: send cursor when a new client is connecting

2016-03-08 Thread Gerd Hoffmann
On Mi, 2016-03-02 at 14:32 +, Frediano Ziglio wrote: > If you have hardware cursor and you are reconnecting the VNC client > you need to send the cursor. Failing to do so make the cursor invisible > till is changed. > > Signed-off-by: Frediano Ziglio added to ui patch queue. thanks, Gerd