[Spice-devel] [spice-gtk v2 12/13] usb-redir: use persistent libusb_device under Windows also

2019-03-18 Thread Yuri Benditovich
Unify SpiceUsbDeviceInfo for Linux and Windows by using persistent libusb_device. Probably there was some problem doing it long time ago with winusb, but at least with existing libusb and UsbDk the the libusb device can be accessed as long as it is referenced. Signed-off-by: Yuri Benditovich ---

[Spice-devel] [spice-gtk v2 09/13] win-usb-dev: do not allocate memory for hub devices

2019-03-18 Thread Yuri Benditovich
When processing list of USB devices, avoid allocating memory for devices which later will be skipped. Use existing libusb struct first to check whether the device shall be excluded. Signed-off-by: Yuri Benditovich --- src/win-usb-dev.c | 27 --- 1 file changed, 12

[Spice-devel] [spice-gtk v2 07/13] usb-redir: discard cold-plug device list under Windows

2019-03-18 Thread Yuri Benditovich
Discard the optimization of initial device enumeration. Just after connection to 'udev' signal request to report all the devices one by one as if they are inserted. Further commits will remove device enumeration in usb-dev-manager completely. Signed-off-by: Yuri Benditovich ---

[Spice-devel] [spice-gtk v2 03/13] usb-redir: reuse libusb context under Windows

2019-03-18 Thread Yuri Benditovich
Do not create own libusb context in usb-device-manager. Reuse existing context created by win-usb-dev instead, this will later allow usb-device-manager to use libusb devices enumerated in win-usb-dev. Signed-off-by: Yuri Benditovich --- src/usb-device-manager.c | 11 +--

[Spice-devel] [spice-gtk v2 08/13] usb-redir: change signal prototype of win-usb-dev

2019-03-18 Thread Yuri Benditovich
Changing signal definition from (boxed-boxed) to (pointer,int). There is no need for additional referencing of GUdevDevice object before signal callback. Second parameter (action) is FALSE for device removal and TRUE for device addition. Signed-off-by: Yuri Benditovich --- src/spice-marshal.txt

[Spice-devel] [spice-gtk v2 06/13] win-usb-dev: remove unused procedure

2019-03-18 Thread Yuri Benditovich
Remove unused g_udev_device_get_sysfs_attr. Signed-off-by: Yuri Benditovich --- src/win-usb-dev.c | 18 -- src/win-usb-dev.h | 1 - 2 files changed, 19 deletions(-) diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c index 52e61a8..6273cbe 100644 --- a/src/win-usb-dev.c +++

[Spice-devel] [spice-gtk v2 02/13] usb-redir: remove unused 'subsystem' parameter

2019-03-18 Thread Yuri Benditovich
Removing unused parameter for GUdevClient constructor. This code is used only in build for Windows. Signed-off-by: Yuri Benditovich --- src/usb-device-manager.c | 5 + src/win-usb-dev.c| 2 +- src/win-usb-dev.h| 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff

[Spice-devel] [spice-gtk v2 05/13] win-usb-dev: strict comparison of USB devices

2019-03-18 Thread Yuri Benditovich
If on device change the new device has the same bus:address as existing device, win-usb-dev does not emit signal of device change (for example, when due to some reason the 'redirecting' property is set for long time and during this time one of devices is changed). Make device comparison more

[Spice-devel] [spice-gtk v2 10/13] win-usb-dev: maintain list of libusb devices

2019-03-18 Thread Yuri Benditovich
Change internal device list to maintain libusb devices instead of GUdevDevice objects. Create temporary GUdevDevice object only for indication to usb-dev-manager. Signed-off-by: Yuri Benditovich --- src/win-usb-dev.c | 80 ++- 1 file changed, 51

[Spice-devel] [spice-gtk v2 00/13] use persistent libusb_device on Windows

2019-03-18 Thread Yuri Benditovich
This series unifies part of USB redirection code for Windows making it the same as for Linux by using persistent libusb_device also on Windows. Changes from v1: minor fixes per v1 review rebase to latest master branch Yuri Benditovich (13): usb-redir: replace USE_GUDEV with G_OS_WIN32

[Spice-devel] [spice-gtk v2 13/13] win-usb-dev: remove unused code

2019-03-18 Thread Yuri Benditovich
Remove unused code related to GUdevDevice. Signed-off-by: Yuri Benditovich --- src/win-usb-dev.c | 74 --- src/win-usb-dev.h | 27 - 2 files changed, 101 deletions(-) diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c index

[Spice-devel] [spice-gtk v2 01/13] usb-redir: replace USE_GUDEV with G_OS_WIN32

2019-03-18 Thread Yuri Benditovich
Replacing USE_GUDEV with G_OS_WIN32 anywhere. GUDEV simulation is used only in Windows build. Signed-off-by: Yuri Benditovich --- src/usb-device-manager.c | 26 +++--- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/usb-device-manager.c

[Spice-devel] [spice-gtk v2 04/13] usb-redir: do not add device if one with the same bus:addr exists

2019-03-18 Thread Yuri Benditovich
In initial device enumeration hotplug notification can be called twice with the same libusb device. For details, see http://libusb.sourceforge.net/api-1.0/group__libusb__hotplug.html#ga00e0c69ddf1fb1b6774dc918192e8dc7 Filter out devices that already present in the list. Remove indentical call in

[Spice-devel] [spice-gtk v2 11/13] win-usb-dev: report libusb_device via signal

2019-03-18 Thread Yuri Benditovich
Change the signal to report libusb_device instead of GUdevDevice object. This simplifies the callback procedure in usb-dev-manager and avoids additional reenumeration immediately after reenumeration that already done by win-usb-dev. Signed-off-by: Yuri Benditovich --- src/usb-device-manager.c |

Re: [Spice-devel] [spice-gtk v3] smartcard: Warn if multiple readers are detected

2019-03-18 Thread Marc-André Lureau
On Fri, Feb 22, 2019 at 11:40 AM Christophe Fergeau wrote: > > spice-server does not deal properly with multiple smartcard readers, > only the first one will be working. Add a warning when this happens to > make it easier to diagnose such issues. > > Signed-off-by: Christophe Fergeau ack > ---

Re: [Spice-devel] [spice-gtk v3] smartcard: Warn if multiple readers are detected

2019-03-18 Thread Christophe Fergeau
Ping? Or should I just go with one of the earlier versions? On Fri, Feb 22, 2019 at 11:40:32AM +0100, Christophe Fergeau wrote: > spice-server does not deal properly with multiple smartcard readers, > only the first one will be working. Add a warning when this happens to > make it easier to

Re: [Spice-devel] [spice-gtk v2 2/2] win-usb-dev: remove ifdef for libusb on 1.0.13

2019-03-18 Thread Christophe Fergeau
On Fri, Feb 22, 2019 at 05:42:22PM +, Victor Toso wrote: > From: Victor Toso > > We already require libusb 1.0.16 or above since 8269a5be62f4ce1 > (build-sys: drop support for libusb < 1.0.16) > > Signed-off-by: Victor Toso > --- > src/win-usb-dev.c | 4 +--- > 1 file changed, 1

Re: [Spice-devel] [spice-gtk 10/13] win-usb-dev: maintain list of libusb devices

2019-03-18 Thread Yuri Benditovich
On Tue, Mar 12, 2019 at 7:22 PM Christophe Fergeau wrote:>> On Sun, Mar 10, 2019 at 04:46:09PM +0200, Yuri Benditovich wrote: > > Change internal device list to maintain libusb devices > > instead of GUdevDevice objects. Create temporary > > GUdevDevice object only for indication to

Re: [Spice-devel] [PATCH spice-common v3 0/5] Generate C declarations automatically

2019-03-18 Thread Jonathon Jongsma
On Mon, 2019-03-18 at 09:53 -0400, Frediano Ziglio wrote: > > On Mon, Mar 11, 2019 at 12:42:10PM -0400, Frediano Ziglio wrote: > > > > > > > > Series looks good to me, > > > > > > > > Reviewed-by: Christophe Fergeau > > > > > > > > > > Why not ack? Not good enough? Not tested? Missing

Re: [Spice-devel] [PATCH spice-server 1/2] docs: Fix typo

2019-03-18 Thread Douglas Paul
On Mon, Mar 18, 2019 at 09:44:59AM -0400, Frediano Ziglio wrote: > > > -Lots of code run in a single thread. > > > +Lots of code runs in a single thread. > > > > "Lots of" is plural, isn't it? Maybe "A lot of code runs .." > > > > Christophe > > > > You are right. Which one is better? FWIW,

Re: [Spice-devel] [PATCH spice-common v3 0/5] Generate C declarations automatically

2019-03-18 Thread Frediano Ziglio
> On Mon, Mar 11, 2019 at 12:42:10PM -0400, Frediano Ziglio wrote: > > > > > > Series looks good to me, > > > > > > Reviewed-by: Christophe Fergeau > > > > > > > Why not ack? Not good enough? Not tested? Missing something? > > libvirt/qemu use of Reviewed-by/Acked-by confuses me, and to me

Re: [Spice-devel] [PATCH spice-server 1/2] docs: Fix typo

2019-03-18 Thread Frediano Ziglio
> > On Mon, Mar 11, 2019 at 02:03:32PM +, Frediano Ziglio wrote: > > Signed-off-by: Frediano Ziglio > > --- > > docs/spice_threading_model.txt | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/docs/spice_threading_model.txt > > b/docs/spice_threading_model.txt

Re: [Spice-devel] [PATCH spice-protocol] protocol: Generate enums.h again to remove old protocol definitions

2019-03-18 Thread Frediano Ziglio
> > This is breaking spice-protocol API even if this should not impact > current code. Do we want to advertise this somehow? Switch to > spice-protocol 0.14.x? > Fine for me both 0.14.0 or 0.12.16 (the future, current HEAD version) > On Fri, Feb 22, 2019 at 12:16:52PM +, Frediano Ziglio

Re: [Spice-devel] [PATCH spice-common v3 0/5] Generate C declarations automatically

2019-03-18 Thread Christophe Fergeau
On Mon, Mar 11, 2019 at 12:42:10PM -0400, Frediano Ziglio wrote: > > > > Series looks good to me, > > > > Reviewed-by: Christophe Fergeau > > > > Why not ack? Not good enough? Not tested? Missing something? libvirt/qemu use of Reviewed-by/Acked-by confuses me, and to me they are more or less

Re: [Spice-devel] [PATCH spice-protocol] protocol: Generate enums.h again to remove old protocol definitions

2019-03-18 Thread Christophe Fergeau
This is breaking spice-protocol API even if this should not impact current code. Do we want to advertise this somehow? Switch to spice-protocol 0.14.x? On Fri, Feb 22, 2019 at 12:16:52PM +, Frediano Ziglio wrote: > spice.proto was updated to remove really old definitions, > update enums.h

Re: [Spice-devel] [PATCH spice-server 2/2] docs: Add some notes on event scheduling and threading

2019-03-18 Thread Christophe Fergeau
On Mon, Mar 11, 2019 at 02:03:33PM +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > docs/spice_threading_model.txt | 8 > 1 file changed, 8 insertions(+) > > diff --git a/docs/spice_threading_model.txt b/docs/spice_threading_model.txt > index 9351141c8..25a3a030c

Re: [Spice-devel] [PATCH spice-server 1/2] docs: Fix typo

2019-03-18 Thread Christophe Fergeau
On Mon, Mar 11, 2019 at 02:03:32PM +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > docs/spice_threading_model.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/docs/spice_threading_model.txt b/docs/spice_threading_model.txt > index

Re: [Spice-devel] [PATCH spice-server 1/2] Update spice-common submodule

2019-03-18 Thread Christophe Fergeau
For the series: Acked-by: Christophe Fergeau On Fri, Mar 08, 2019 at 12:25:48PM +, Frediano Ziglio wrote: > This brings in the following changes: > > Frediano Ziglio (11): > codegen: Document ptr_array attribute > codegen: Use a better type for pointer converted to integer >

Re: [Spice-devel] [PATCH spice-server] syntax-check: Add missing contributors names to AUTHORS

2019-03-18 Thread Christophe Fergeau
Acked-by: Christophe Fergeau On Mon, Mar 18, 2019 at 10:57:41AM +, Frediano Ziglio wrote: > Signed-off-by: Frediano Ziglio > --- > AUTHORS | 1 + > 1 file changed, 1 insertion(+) > > This fixed "make syntax-check" > > diff --git a/AUTHORS b/AUTHORS > index 12158e60..a9b9ea79 100644 >

Re: [Spice-devel] Build error (possible mirroring issue?)

2019-03-18 Thread Frediano Ziglio
> > Hey team, > > > I get a build failure that looks like this: > > char-device.c:906:52: error: too many arguments to function call, expected > single argument 'm', have 2 arguments > m2 = spice_marshaller_get_ptr_submarshaller(m, 0); > ~~^

[Spice-devel] Build error (possible mirroring issue?)

2019-03-18 Thread Christophe de Dinechin
Hey team, I get a build failure that looks like this: char-device.c:906:52: error: too many arguments to function call, expected single argument 'm', have 2 arguments m2 = spice_marshaller_get_ptr_submarshaller(m, 0); ~~^

[Spice-devel] [PATCH spice-server] syntax-check: Add missing contributors names to AUTHORS

2019-03-18 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- AUTHORS | 1 + 1 file changed, 1 insertion(+) This fixed "make syntax-check" diff --git a/AUTHORS b/AUTHORS index 12158e60..a9b9ea79 100644 --- a/AUTHORS +++ b/AUTHORS @@ -66,5 +66,6 @@ Patches also contributed by Wang Qiang Yann E. MORIN

Re: [Spice-devel] [PATCH spice-server] reds: Check we don't register a channel twice in reds_register_channel

2019-03-18 Thread Frediano Ziglio
> On 3/18/19 12:12 PM, Frediano Ziglio wrote: > >> Hi, > >> > >> On 3/15/19 11:27 AM, Frediano Ziglio wrote: > >>> To avoid possibly regression check it only if extra checks are > >>> enabled. > >> > >> Currently there's already a "channel duplication" warning upon connection > >> but won't hurt

Re: [Spice-devel] [PATCH spice-server v4 1/1] video-stream: prevent crash on stream reattach

2019-03-18 Thread Frediano Ziglio
> > I experienced some crashes with qemu 3.1.0 compiled with libspice-server > 0.14.0 on Gentoo. > > The problem reproduced reliably with a guest running Ubuntu 18.04.2 LTS. > If I connect a viewer at system startup, I would get a crash just after > the fade-in of the login prompt in GDM. > >

Re: [Spice-devel] [PATCH spice-server] reds: Check we don't register a channel twice in reds_register_channel

2019-03-18 Thread Snir Sheriber
On 3/18/19 12:12 PM, Frediano Ziglio wrote: Hi, On 3/15/19 11:27 AM, Frediano Ziglio wrote: To avoid possibly regression check it only if extra checks are enabled. Currently there's already a "channel duplication" warning upon connection but won't hurt to have this extra check and emit an

Re: [Spice-devel] [PATCH spice-server 2/2] docs: Add some notes on event scheduling and threading

2019-03-18 Thread Frediano Ziglio
ping > > Signed-off-by: Frediano Ziglio > --- > docs/spice_threading_model.txt | 8 > 1 file changed, 8 insertions(+) > > diff --git a/docs/spice_threading_model.txt b/docs/spice_threading_model.txt > index 9351141c8..25a3a030c 100644 > --- a/docs/spice_threading_model.txt > +++

Re: [Spice-devel] [PATCH v2 spice-gtk] Adjust to window scaling

2019-03-18 Thread Frediano Ziglio
> > When GDK_SCALE is != 1 and egl is used, the image presented does not > fit to the window (scale of 2 is often used with hidpi monitors). > Usually this is not a problem since all components are adjusted by > gdk/gtk but with egl, pixel-based data is not being scaled. In this > case window's

Re: [Spice-devel] [PATCH spice-server] reds: Check we don't register a channel twice in reds_register_channel

2019-03-18 Thread Frediano Ziglio
> > Hi, > > On 3/15/19 11:27 AM, Frediano Ziglio wrote: > > To avoid possibly regression check it only if extra checks are > > enabled. > > > Currently there's already a "channel duplication" warning upon connection > but won't hurt to have this extra check and emit an error. > I cannot find

Re: [Spice-devel] [PATCH spice-server] reds: Check we don't register a channel twice in reds_register_channel

2019-03-18 Thread Snir Sheriber
Hi, On 3/15/19 11:27 AM, Frediano Ziglio wrote: To avoid possibly regression check it only if extra checks are enabled. Currently there's already a "channel duplication" warning upon connection but won't hurt to have this extra check and emit an error. This allowed to check previous "Move