Re: [Spice-devel] [PATCH] covscan: add comment on false-positive on g_memdup()

2019-08-27 Thread Uri Lublin
On 8/27/19 6:16 PM, Victor Toso wrote: From: Victor Toso Previous commit set last element of orig_argv array to NULL. That's redundant as g_memdup() uses memcpy() and it would do just that. Add a comment that the reason for this change is to workaround clang's warning. Suggested by Uri. Signed

Re: [Spice-devel] [PATCH spice-gtk 2/2] Add copr builds integration

2019-08-27 Thread Marc-André Lureau
Hi On Tue, Aug 27, 2019 at 6:27 PM Snir Sheriber wrote: > > This will let copr to generate srpm using the .copr/Makefile script Do we really want to maintain that kind of distro things upstream? Do we need it? What does it bring that gitlab CI doesn't have? > > Signed-off-by: Snir Sheriber >

Re: [Spice-devel] [PATCH spice-gtk 2/2] Add copr builds integration

2019-08-27 Thread Frediano Ziglio
> > This will let copr to generate srpm using the .copr/Makefile script > > Signed-off-by: Snir Sheriber > --- > .copr/Makefile | 29 + > 1 file changed, 29 insertions(+) > create mode 100644 .copr/Makefile > > diff --git a/.copr/Makefile b/.copr/Makefile > new fil

Re: [Spice-devel] [PATCH spice-gtk v4 18/29] build: Do not build usbredir dependent file is usbredir disabled

2019-08-27 Thread Frediano Ziglio
> > Hi, > > On Tue, Aug 27, 2019 at 10:22:35AM +0100, Frediano Ziglio wrote: > > These files would end up to compile empty code, no reason > > to compile and link them. > > > > Signed-off-by: Frediano Ziglio > > --- > > src/meson.build | 10 +- > > 1 file changed, 5 insertions(+), 5 de

Re: [Spice-devel] [PATCH spice-gtk v4 09/29] usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Frediano Ziglio
> > Hi, > > On Tue, Aug 27, 2019 at 10:22:26AM +0100, Frediano Ziglio wrote: > > From: Yuri Benditovich > > > > Files added without including them in compilation. > > They contain implementation of SCSI commands for logical > > units of mass-storage device class and USB bulk-only > > mass-stora

[Spice-devel] [PATCH] covscan: add comment on false-positive on g_memdup()

2019-08-27 Thread Victor Toso
From: Victor Toso Previous commit set last element of orig_argv array to NULL. That's redundant as g_memdup() uses memcpy() and it would do just that. Add a comment that the reason for this change is to workaround clang's warning. Suggested by Uri. Signed-off-by: Victor Toso --- src/vdagent/vd

Re: [Spice-devel] [PATCH v2 1/2] covscan: initialize argv's copy

2019-08-27 Thread Uri Lublin
On 8/27/19 3:42 PM, Victor Toso wrote: From: Victor Toso Otherwise we get a CLANG_WARNING due accessing garbage. Covscan report: > spice-vdagent-0.19.0/src/vdagent/vdagent.c:471:9: warning: 1st function call argument is an uninitialized value > #execvp(orig_argv[0], orig_argv);

Re: [Spice-devel] [PATCH spice-gtk v4 14/29] fixup! usb-redir: add implementation of emulated CD device

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 10:14:16AM -0400, Frediano Ziglio wrote: > > > > Hi, > > > > On Tue, Aug 27, 2019 at 10:22:31AM +0100, Frediano Ziglio wrote: > > > Add comment on constant > > > --- > > > src/usb-device-cd.c | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/src/usb-de

Re: [Spice-devel] [PATCH spice-gtk 1/2] Add spec.in file and spec file generation

2019-08-27 Thread Frediano Ziglio
I posted a similar patch for another SPICE project, fine adding SPEC to the repository. The spec seems already "evolved" from a past history. Where did you get it from? I think that comment should be on the commit message. Also, is that spec file supposed to be used for releases (like for Fedora) ?

Re: [Spice-devel] [PATCH spice-gtk v4 19/29] usb-redir: command-line option to create emulated CD drive

2019-08-27 Thread Frediano Ziglio
> > Hi, > > On Tue, Aug 27, 2019 at 10:22:36AM +0100, Frediano Ziglio wrote: > > From: Yuri Benditovich > > > > Added command-line option for sharing emulated CD devices. > > It uses property interface of usb-device-manager to > > create CD, this is a temporary solution until public API of > >

Re: [Spice-devel] [PATCH spice-gtk v4 26/29] test-cd-emu: Test attach/detach emulated device

2019-08-27 Thread Frediano Ziglio
> > Hi, > > On Tue, Aug 27, 2019 at 10:22:43AM +0100, Frediano Ziglio wrote: > > Mock some usb-backend functions to be able to simulate device > > attachment and detachment. > > Create session and channel to pass some valid pointer anyway. > > Emulate channel state correctly. > > Make sure HELLO

Re: [Spice-devel] [PATCH spice-gtk v4 20/29] test-cd-emu: Add base test for cd-emulation

2019-08-27 Thread Frediano Ziglio
> > Hi, > > On Tue, Aug 27, 2019 at 10:22:37AM +0100, Frediano Ziglio wrote: > > Just allocate and free to test for base leaks and reference > > counting. > > > > Signed-off-by: Frediano Ziglio > > Valgrind says ok here as well. > > > --- > > tests/cd-emu.c| 92 ++

[Spice-devel] [PATCH spice-gtk 2/2] Add copr builds integration

2019-08-27 Thread Snir Sheriber
This will let copr to generate srpm using the .copr/Makefile script Signed-off-by: Snir Sheriber --- .copr/Makefile | 29 + 1 file changed, 29 insertions(+) create mode 100644 .copr/Makefile diff --git a/.copr/Makefile b/.copr/Makefile new file mode 100644 index 000

[Spice-devel] [PATCH spice-gtk 1/2] Add spec.in file and spec file generation

2019-08-27 Thread Snir Sheriber
Signed-off-by: Snir Sheriber --- Test build: https://copr.fedorainfracloud.org/coprs/snir/spice-project/build/1021943/ --- meson.build | 11 +++ spice-gtk.spec.in | 190 ++ 2 files changed, 201 insertions(+) create mode 100644 spice-gtk.spec.in

Re: [Spice-devel] [PATCH spice-gtk v4 21/29] CI: Add --werror

2019-08-27 Thread Frediano Ziglio
> > Hi, > > On Tue, Aug 27, 2019 at 12:43:36PM +0200, Christophe de Dinechin wrote: > > > > Frediano Ziglio writes: > > > > > Give errors on warnings, we want the code to compile without > > > warnings, at least with CI. > > > > Looks good to me, but from experience with other projects, > > ne

Re: [Spice-devel] [PATCH spice-gtk v4 14/29] fixup! usb-redir: add implementation of emulated CD device

2019-08-27 Thread Frediano Ziglio
> > Hi, > > On Tue, Aug 27, 2019 at 10:22:31AM +0100, Frediano Ziglio wrote: > > Add comment on constant > > --- > > src/usb-device-cd.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c > > index c33bb290..2234289c 100644 > > --- a/src/usb

Re: [Spice-devel] [linux/vd_agent v1 1/2] covscan: check and initialize argv's copy

2019-08-27 Thread Uri Lublin
On 8/27/19 4:35 PM, Victor Toso wrote: Hi, Sorry, forgot to reply earlier. On Tue, Aug 27, 2019 at 03:12:24PM +0300, Uri Lublin wrote: On 8/27/19 1:27 PM, Frediano Ziglio wrote: From: Victor Toso Otherwise we get a CLANG_WARNING due accessing garbage. Covscan report: > spice-vdagent-0.

Re: [Spice-devel] [PATCH spice-gtk v4 26/29] test-cd-emu: Test attach/detach emulated device

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:43AM +0100, Frediano Ziglio wrote: > Mock some usb-backend functions to be able to simulate device > attachment and detachment. > Create session and channel to pass some valid pointer anyway. > Emulate channel state correctly. > Make sure HELLO packets are sent co

Re: [Spice-devel] [PATCH spice-gtk v4 23/29] cd-scsi: Do not export sense code constants

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:40AM +0100, Frediano Ziglio wrote: > They are used only inside the module. > Use a macro to simplify declaration which is pretty long. > > Signed-off-by: Frediano Ziglio Improves a bit yes, Acked-by: Victor Toso > --- > src/cd-scsi.c | 54

Re: [Spice-devel] [PATCH spice-gtk v4 22/29] CI: Add usbredir packages to Windows

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:39AM +0100, Frediano Ziglio wrote: > Allows Windows job to build USB code part to make sure it compiles > correctly. > > Signed-off-by: Frediano Ziglio Ah! Acked-by: Victor Toso > --- > .gitlab-ci.yml | 1 + > 1 file changed, 1 insertion(+) > > diff --git a

Re: [Spice-devel] [PATCH spice-gtk v4 21/29] CI: Add --werror

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 12:43:36PM +0200, Christophe de Dinechin wrote: > > Frediano Ziglio writes: > > > Give errors on warnings, we want the code to compile without > > warnings, at least with CI. > > Looks good to me, but from experience with other projects, > new compiler releases tend

Re: [Spice-devel] [linux/vd_agent v1 1/2] covscan: check and initialize argv's copy

2019-08-27 Thread Victor Toso
Hi, Sorry, forgot to reply earlier. On Tue, Aug 27, 2019 at 03:12:24PM +0300, Uri Lublin wrote: > On 8/27/19 1:27 PM, Frediano Ziglio wrote: > > > > > > From: Victor Toso > > > > > > Otherwise we get a CLANG_WARNING due accessing garbage. > > > > > > Covscan report: > > > > spice-vdagent-0.

Re: [Spice-devel] [PATCH spice-gtk v4 20/29] test-cd-emu: Add base test for cd-emulation

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:37AM +0100, Frediano Ziglio wrote: > Just allocate and free to test for base leaks and reference > counting. > > Signed-off-by: Frediano Ziglio Valgrind says ok here as well. > --- > tests/cd-emu.c| 92 +++ > te

[Spice-devel] [PATCH v2 1/2] covscan: initialize argv's copy

2019-08-27 Thread Victor Toso
From: Victor Toso Otherwise we get a CLANG_WARNING due accessing garbage. Covscan report: > spice-vdagent-0.19.0/src/vdagent/vdagent.c:471:9: warning: 1st function call > argument is an uninitialized value > #execvp(orig_argv[0], orig_argv); > #^ > spice-v

Re: [Spice-devel] [linux/vd_agent v1 1/2] covscan: check and initialize argv's copy

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 06:27:27AM -0400, Frediano Ziglio wrote: > > > > From: Victor Toso > > > > Otherwise we get a CLANG_WARNING due accessing garbage. > > > > Covscan report: > > > spice-vdagent-0.19.0/src/vdagent/vdagent.c:471:9: warning: 1st function > > > call argument is an unini

Re: [Spice-devel] [linux/vd_agent v1 2/2] covscan: avoid false positive on g_clear_pointer()

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 06:29:23AM -0400, Frediano Ziglio wrote: > > > > From: Victor Toso > > > > This is a CLANG_WARNING found by covscan. It is a false positive as > > g_clear_pointer() does set vportp to NULL, meaning that the situation > > described by covscan below should not be reached. M

Re: [Spice-devel] [PATCH spice-gtk v4 19/29] usb-redir: command-line option to create emulated CD drive

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:36AM +0100, Frediano Ziglio wrote: > From: Yuri Benditovich > > Added command-line option for sharing emulated CD devices. > It uses property interface of usb-device-manager to > create CD, this is a temporary solution until public API of > usb-device-manager de

Re: [Spice-devel] [PATCH spice-gtk v4 18/29] build: Do not build usbredir dependent file is usbredir disabled

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:35AM +0100, Frediano Ziglio wrote: > These files would end up to compile empty code, no reason > to compile and link them. > > Signed-off-by: Frediano Ziglio > --- > src/meson.build | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --

Re: [Spice-devel] [PATCH spice-gtk v4 17/29] fixup! usb-redir: enable redirection of emulated CD drive

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 10:22:34AM +0100, Frediano Ziglio wrote: > Minor styles, spaces, double end of statement. > --- > src/usb-device-cd.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c > index 2234289c..2f421c42 100644 >

Re: [Spice-devel] [PATCH spice-gtk v4 16/29] fixup! usb-redir: enable redirection of emulated CD drive

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:33AM +0100, Frediano Ziglio wrote: > Do not build usb emulation files if usb is disabled > --- > src/meson.build | 19 --- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/src/meson.build b/src/meson.build > index 8bfc923b..00e

Re: [Spice-devel] [PATCH spice-gtk v4 14/29] fixup! usb-redir: add implementation of emulated CD device

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:31AM +0100, Frediano Ziglio wrote: > Add comment on constant > --- > src/usb-device-cd.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c > index c33bb290..2234289c 100644 > --- a/src/usb-device-cd.c > +++ b/src/

Re: [Spice-devel] [PATCH spice-gtk v4 12/29] fixup! usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 10:22:29AM +0100, Frediano Ziglio wrote: > Do not use G_GUINT32_FORMAT. > We support a minimum of 32 bit architectures. Acked-by: Victor Toso > --- > src/cd-usb-bulk-msd.c | 53 +-- > 1 file changed, 26 insertions(+), 27 deletions(-)

Re: [Spice-devel] [linux/vd_agent v1 1/2] covscan: check and initialize argv's copy

2019-08-27 Thread Uri Lublin
On 8/27/19 1:27 PM, Frediano Ziglio wrote: From: Victor Toso Otherwise we get a CLANG_WARNING due accessing garbage. Covscan report: > spice-vdagent-0.19.0/src/vdagent/vdagent.c:471:9: warning: 1st function > call argument is an uninitialized value > #execvp(orig_argv[0], orig_a

Re: [Spice-devel] [PATCH spice-gtk v4 26/29] test-cd-emu: Test attach/detach emulated device

2019-08-27 Thread Christophe de Dinechin
Frediano Ziglio writes: >> >> Frediano Ziglio writes: >> >> > Mock some usb-backend functions to be able to simulate device >> > attachment and detachment. >> > + >> > +// this it's the correct sequence to free session! >> > +// g_object_unref is not enough, causing wrong reference counti

Re: [Spice-devel] [PATCH spice-gtk v4 21/29] CI: Add --werror

2019-08-27 Thread Christophe de Dinechin
Frediano Ziglio writes: > Give errors on warnings, we want the code to compile without > warnings, at least with CI. Looks good to me, but from experience with other projects, new compiler releases tend to add new warnings that will break your builds. You don't control the release timeline of co

Re: [Spice-devel] [PATCH spice-gtk v4 24/29] usb-backend: Rewrite USB emulation support

2019-08-27 Thread Christophe de Dinechin
Frediano Ziglio writes: > Make initialisation easier. > Always initialise parser. My spellchecker seems to choke on "initialise", suggests "initialize" (maybe a UK/US difference). > Initialise both parser and host during spice_usb_backend_channel_new. > Support not having libusb context (no phy

Re: [Spice-devel] [linux/vd_agent v1 2/2] covscan: avoid false positive on g_clear_pointer()

2019-08-27 Thread Frediano Ziglio
> > From: Victor Toso > > This is a CLANG_WARNING found by covscan. It is a false positive as > g_clear_pointer() does set vportp to NULL, meaning that the situation > described by covscan below should not be reached. Moving away from > g_clear_pointer() in this specific case just to make our to

Re: [Spice-devel] [PATCH spice-gtk v4 11/29] fixup! usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Frediano Ziglio
> > On Tue, Aug 27, 2019 at 10:22:28AM +0100, Frediano Ziglio wrote: > > Do not wrap all declarations, keep out external headers > > --- > > src/cd-usb-bulk-msd.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/src/cd-usb-bulk-msd.h b/src/cd-usb-bulk-msd.h > >

Re: [Spice-devel] [linux/vd_agent v1 1/2] covscan: check and initialize argv's copy

2019-08-27 Thread Frediano Ziglio
> > From: Victor Toso > > Otherwise we get a CLANG_WARNING due accessing garbage. > > Covscan report: > > spice-vdagent-0.19.0/src/vdagent/vdagent.c:471:9: warning: 1st function > > call argument is an uninitialized value > > #execvp(orig_argv[0], orig_argv); > > #^ ~~~

Re: [Spice-devel] [PATCH spice-gtk v4 11/29] fixup! usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 10:22:28AM +0100, Frediano Ziglio wrote: > Do not wrap all declarations, keep out external headers > --- > src/cd-usb-bulk-msd.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/cd-usb-bulk-msd.h b/src/cd-usb-bulk-msd.h > index 85661165..c16

Re: [Spice-devel] [PATCH spice-gtk v4 10/29] fixup! usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 10:22:27AM +0100, Frediano Ziglio wrote: > Update guard style > --- > src/cd-scsi-dev-params.h | 5 + > src/cd-scsi.h| 5 + > src/cd-usb-bulk-msd.h| 5 + > src/scsi-constants.h | 5 + > 4 files changed, 4 insertions(+), 16 deletions(-) Ac

Re: [Spice-devel] [PATCH spice-gtk v4 09/29] usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:26AM +0100, Frediano Ziglio wrote: > From: Yuri Benditovich > > Files added without including them in compilation. > They contain implementation of SCSI commands for logical > units of mass-storage device class and USB bulk-only > mass-storage device protocol. >

Re: [Spice-devel] [PATCH spice-gtk v4 26/29] test-cd-emu: Test attach/detach emulated device

2019-08-27 Thread Frediano Ziglio
> > Frediano Ziglio writes: > > > Mock some usb-backend functions to be able to simulate device > > attachment and detachment. > > + > > +// this it's the correct sequence to free session! > > +// g_object_unref is not enough, causing wrong reference countings > > +spice_session_disco

[Spice-devel] [linux/vd_agent v1 1/2] covscan: check and initialize argv's copy

2019-08-27 Thread Victor Toso
From: Victor Toso Otherwise we get a CLANG_WARNING due accessing garbage. Covscan report: > spice-vdagent-0.19.0/src/vdagent/vdagent.c:471:9: warning: 1st function call > argument is an uninitialized value > #execvp(orig_argv[0], orig_argv); > #^ > spice-v

[Spice-devel] [linux/vd_agent v1 2/2] covscan: avoid false positive on g_clear_pointer()

2019-08-27 Thread Victor Toso
From: Victor Toso This is a CLANG_WARNING found by covscan. It is a false positive as g_clear_pointer() does set vportp to NULL, meaning that the situation described by covscan below should not be reached. Moving away from g_clear_pointer() in this specific case just to make our tool happy. Covs

Re: [Spice-devel] [PATCH spice-gtk v4 26/29] test-cd-emu: Test attach/detach emulated device

2019-08-27 Thread Christophe de Dinechin
Frediano Ziglio writes: > Mock some usb-backend functions to be able to simulate device > attachment and detachment. > + > +// this it's the correct sequence to free session! > +// g_object_unref is not enough, causing wrong reference countings > +spice_session_disconnect(session); >

Re: [Spice-devel] [PATCH spice-gtk v4 27/29] test-cd-emu: Test detach and reattach

2019-08-27 Thread Frediano Ziglio
> > > Frediano Ziglio writes: > > > Make sure device can be detached and attached again. > > > > Signed-off-by: Frediano Ziglio > > --- > > tests/cd-emu.c | 105 +++-- > > 1 file changed, 76 insertions(+), 29 deletions(-) > > > > diff --git a/tests/c

Re: [Spice-devel] [PATCH spice-gtk v4 29/29] test-cd-emu: Test no libusb context support

2019-08-27 Thread Christophe de Dinechin
Frediano Ziglio writes: > Although currently not supported the code try to support it "not supported in the code, try to support it" ? (Not really sure what you really mean) > in order to be able to have only emulated devices if the > libusb layer is failing. > > Signed-off-by: Frediano Ziglio

Re: [Spice-devel] [PATCH spice-gtk v4 27/29] test-cd-emu: Test detach and reattach

2019-08-27 Thread Christophe de Dinechin
Frediano Ziglio writes: > Make sure device can be detached and attached again. > > Signed-off-by: Frediano Ziglio > --- > tests/cd-emu.c | 105 +++-- > 1 file changed, 76 insertions(+), 29 deletions(-) > > diff --git a/tests/cd-emu.c b/tests/cd-emu.c

Re: [Spice-devel] [PATCH spice-gtk v4 06/29] usb-redir: extend USB backend to support emulated devices

2019-08-27 Thread Victor Toso
Hi, Didn't check the whole series yet but I recall some other comments in the patch besides the fixup. I'll comment later on it. On Tue, Aug 27, 2019 at 10:22:23AM +0100, Frediano Ziglio wrote: > From: Yuri Benditovich > > Redirection of emulated devices requires special approach, > as usbredir

Re: [Spice-devel] [PATCH spice-gtk v4 08/29] fixup! usb-redir: extend USB backend to support emulated devices

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 10:22:25AM +0100, Frediano Ziglio wrote: > Indentation function declaration Acked-by: Victor Toso > --- > src/usb-backend.c | 41 + > 1 file changed, 21 insertions(+), 20 deletions(-) > > diff --git a/src/usb-backend.c b/src/usb-bac

Re: [Spice-devel] [PATCH spice-gtk v4 07/29] fixup! usb-redir: extend USB backend to support emulated devices

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 10:22:24AM +0100, Frediano Ziglio wrote: > Rename wait_disc_ack, confusing "disc" Acked-by: Victor Toso > --- > src/usb-backend.c | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/src/usb-backend.c b/src/usb-backend.c > index 9369bf5e

Re: [Spice-devel] [PATCH spice-gtk v4 01/29] usb-redir: define interfaces to support emulated devices

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:18AM +0100, Frediano Ziglio wrote: > From: Yuri Benditovich > > SpiceUsbBackendDevice structure is extended to support > additional kind of device that is emulated by Spice-GTK > and not present locally (and does not have libusb_device), > such device has instea

Re: [Spice-devel] [PATCH spice-gtk v4 04/29] fixup! usb-redir: move implementation of device description to USB backend

2019-08-27 Thread Victor Toso
On Tue, Aug 27, 2019 at 10:22:21AM +0100, Frediano Ziglio wrote: > Really minor space removal sure, Acked-by: Victor Toso > --- > src/usb-backend.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/usb-backend.c b/src/usb-backend.c > index aa11c791..252c0a64 10064

Re: [Spice-devel] [PATCH spice-gtk v4 02/29] fixup! usb-redir: define interfaces to support emulated devices

2019-08-27 Thread Victor Toso
Hi, On Tue, Aug 27, 2019 at 10:22:19AM +0100, Frediano Ziglio wrote: > Cosmetic style fixes > --- > src/usb-backend.c | 17 +++-- > 1 file changed, 11 insertions(+), 6 deletions(-) > > diff --git a/src/usb-backend.c b/src/usb-backend.c > index de2b55ec..7f9fcc17 100644 > --- a/src/us

Re: [Spice-devel] [PATCH spice-gtk v4 00/29] added feature of sharing CD image

2019-08-27 Thread Frediano Ziglio
> > Some updates to the series. > Some minor styles updates. > Big changes are the some rewrite of the USB emulation layer and > the test which is now testing attach/detach properly. > Series also at https://cgit.freedesktop.org/~fziglio/spice-gtk/log/?h=send, CI results at https://gitlab.freed

[Spice-devel] [PATCH spice-gtk v4 16/29] fixup! usb-redir: enable redirection of emulated CD drive

2019-08-27 Thread Frediano Ziglio
Do not build usb emulation files if usb is disabled --- src/meson.build | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/meson.build b/src/meson.build index 8bfc923b..00eb2778 100644 --- a/src/meson.build +++ b/src/meson.build @@ -124,13 +124,6 @@ spice_

[Spice-devel] [PATCH spice-gtk v4 21/29] CI: Add --werror

2019-08-27 Thread Frediano Ziglio
Give errors on warnings, we want the code to compile without warnings, at least with CI. Signed-off-by: Frediano Ziglio --- .gitlab-ci.yml | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa70f7ad..8bcef65d 100644 --- a/.gitlab-

[Spice-devel] [PATCH spice-gtk v4 26/29] test-cd-emu: Test attach/detach emulated device

2019-08-27 Thread Frediano Ziglio
Mock some usb-backend functions to be able to simulate device attachment and detachment. Create session and channel to pass some valid pointer anyway. Emulate channel state correctly. Make sure HELLO packets are sent correctly at the beginning and no more afterwards. Test auto-connect enabled or di

[Spice-devel] [PATCH spice-gtk v4 29/29] test-cd-emu: Test no libusb context support

2019-08-27 Thread Frediano Ziglio
Although currently not supported the code try to support it in order to be able to have only emulated devices if the libusb layer is failing. Signed-off-by: Frediano Ziglio --- tests/cd-emu.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/cd-emu.c b/t

[Spice-devel] [PATCH spice-gtk v4 24/29] usb-backend: Rewrite USB emulation support

2019-08-27 Thread Frediano Ziglio
Make initialisation easier. Always initialise parser. Initialise both parser and host during spice_usb_backend_channel_new. Support not having libusb context (no physical devices). Avoids too much state variables. parser is always initialised after creation making sure the state is consistent. Use

[Spice-devel] [PATCH spice-gtk v4 17/29] fixup! usb-redir: enable redirection of emulated CD drive

2019-08-27 Thread Frediano Ziglio
Minor styles, spaces, double end of statement. --- src/usb-device-cd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c index 2234289c..2f421c42 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -86,7 +86,7 @@ struct Spic

[Spice-devel] [PATCH spice-gtk v4 27/29] test-cd-emu: Test detach and reattach

2019-08-27 Thread Frediano Ziglio
Make sure device can be detached and attached again. Signed-off-by: Frediano Ziglio --- tests/cd-emu.c | 105 +++-- 1 file changed, 76 insertions(+), 29 deletions(-) diff --git a/tests/cd-emu.c b/tests/cd-emu.c index f092..8bc3a7ed 100644 --- a/te

[Spice-devel] [PATCH spice-gtk v4 22/29] CI: Add usbredir packages to Windows

2019-08-27 Thread Frediano Ziglio
Allows Windows job to build USB code part to make sure it compiles correctly. Signed-off-by: Frediano Ziglio --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8bcef65d..e2d1c55b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +

[Spice-devel] [PATCH spice-gtk v4 18/29] build: Do not build usbredir dependent file is usbredir disabled

2019-08-27 Thread Frediano Ziglio
These files would end up to compile empty code, no reason to compile and link them. Signed-off-by: Frediano Ziglio --- src/meson.build | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/meson.build b/src/meson.build index 00eb2778..0461dea6 100644 --- a/src/meson.

[Spice-devel] [PATCH spice-gtk v4 23/29] cd-scsi: Do not export sense code constants

2019-08-27 Thread Frediano Ziglio
They are used only inside the module. Use a macro to simplify declaration which is pretty long. Signed-off-by: Frediano Ziglio --- src/cd-scsi.c | 54 ++- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/src/cd-scsi.c b/src/cd-scsi.c

[Spice-devel] [PATCH spice-gtk v4 20/29] test-cd-emu: Add base test for cd-emulation

2019-08-27 Thread Frediano Ziglio
Just allocate and free to test for base leaks and reference counting. Signed-off-by: Frediano Ziglio --- tests/cd-emu.c| 92 +++ tests/meson.build | 4 +++ 2 files changed, 96 insertions(+) create mode 100644 tests/cd-emu.c diff --git a/tests/cd

[Spice-devel] [PATCH spice-gtk v4 19/29] usb-redir: command-line option to create emulated CD drive

2019-08-27 Thread Frediano Ziglio
From: Yuri Benditovich Added command-line option for sharing emulated CD devices. It uses property interface of usb-device-manager to create CD, this is a temporary solution until public API of usb-device-manager defined for shared CD management from both GUI and command line. Signed-off-by: Yur

[Spice-devel] [PATCH spice-gtk v4 28/29] test-cd-emu: Make sure we can call spice_usb_backend_channel_flush_writes

2019-08-27 Thread Frediano Ziglio
Currently we call this function when the SPICE channel is up however this function should continue to work as in theory the channel could avoid to handle the message and stop the flow (for instance to implement some kind of flow limitation) and so will need to call this function again. This was fai

[Spice-devel] [PATCH spice-gtk v4 25/29] build: Use a convenience library for tests

2019-08-27 Thread Frediano Ziglio
Instead of linking all object inside spice-client-glib build a library from these object and link to each test. This will allow to override some object file for mocking purposes. Signed-off-by: Frediano Ziglio --- tests/meson.build | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) di

[Spice-devel] [PATCH spice-gtk v4 01/29] usb-redir: define interfaces to support emulated devices

2019-08-27 Thread Frediano Ziglio
From: Yuri Benditovich SpiceUsbBackendDevice structure is extended to support additional kind of device that is emulated by Spice-GTK and not present locally (and does not have libusb_device), such device has instead pointer to SpiceUsbEmulatedDevice abstract structure. Specific implementation of

[Spice-devel] [PATCH spice-gtk v4 15/29] usb-redir: enable redirection of emulated CD drive

2019-08-27 Thread Frediano Ziglio
From: Yuri Benditovich Add implementation of emulated device to build. Now it is possible to create emulated CD devices. Signed-off-by: Yuri Benditovich --- src/meson.build | 7 +++ 1 file changed, 7 insertions(+) diff --git a/src/meson.build b/src/meson.build index 4d9215c8..8bfc923b 100

[Spice-devel] [PATCH spice-gtk v4 13/29] usb-redir: add implementation of emulated CD device

2019-08-27 Thread Frediano Ziglio
From: Yuri Benditovich This module contains implementation of emulated device interface for shared CD. Signed-off-by: Yuri Benditovich --- src/usb-device-cd.c | 783 src/usb-device-cd.h | 34 ++ 2 files changed, 817 insertions(+) create mode 10064

[Spice-devel] [PATCH spice-gtk v4 12/29] fixup! usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Frediano Ziglio
Do not use G_GUINT32_FORMAT. We support a minimum of 32 bit architectures. --- src/cd-usb-bulk-msd.c | 53 +-- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c index 49e01eb6..5d95dac7 100644 --- a

[Spice-devel] [PATCH spice-gtk v4 14/29] fixup! usb-redir: add implementation of emulated CD device

2019-08-27 Thread Frediano Ziglio
Add comment on constant --- src/usb-device-cd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c index c33bb290..2234289c 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -57,6 +57,7 @@ typedef struct SpiceCdLU { #define MAX_LUN_PER_DEVI

[Spice-devel] [PATCH spice-gtk v4 11/29] fixup! usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Frediano Ziglio
Do not wrap all declarations, keep out external headers --- src/cd-usb-bulk-msd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cd-usb-bulk-msd.h b/src/cd-usb-bulk-msd.h index 85661165..c165c187 100644 --- a/src/cd-usb-bulk-msd.h +++ b/src/cd-usb-bulk-msd.h @@ -21,12

[Spice-devel] [PATCH spice-gtk v4 08/29] fixup! usb-redir: extend USB backend to support emulated devices

2019-08-27 Thread Frediano Ziglio
Indentation function declaration --- src/usb-backend.c | 41 + 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index 13d24d52..36a73a89 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -794,9 +79

[Spice-devel] [PATCH spice-gtk v4 05/29] usb-redir: do not use spice_usb_acl_helper for emulated devices

2019-08-27 Thread Frediano Ziglio
From: Yuri Benditovich Signed-off-by: Yuri Benditovich Acked-by: Frediano Ziglio --- src/channel-usbredir.c | 31 +++ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c index 8d4cd664..8fd6b41c 100644 ---

[Spice-devel] [PATCH spice-gtk v4 07/29] fixup! usb-redir: extend USB backend to support emulated devices

2019-08-27 Thread Frediano Ziglio
Rename wait_disc_ack, confusing "disc" --- src/usb-backend.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index 9369bf5e..13d24d52 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -94,7 +94,7 @@ struct _SpiceUsbBa

[Spice-devel] [PATCH spice-gtk v4 10/29] fixup! usb-redir: add files for SCSI and USB MSC implementation

2019-08-27 Thread Frediano Ziglio
Update guard style --- src/cd-scsi-dev-params.h | 5 + src/cd-scsi.h| 5 + src/cd-usb-bulk-msd.h| 5 + src/scsi-constants.h | 5 + 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/cd-scsi-dev-params.h b/src/cd-scsi-dev-params.h index b480bcdc.

[Spice-devel] [PATCH spice-gtk v4 03/29] usb-redir: move implementation of device description to USB backend

2019-08-27 Thread Frediano Ziglio
From: Yuri Benditovich For local USB device the USB backend returns the same device description as spice-usb-manager did, for emulated devices it uses the description provided by device's implementation. Signed-off-by: Yuri Benditovich Acked-by: Frediano Ziglio --- src/usb-backend.c|

[Spice-devel] [PATCH spice-gtk v4 00/29] added feature of sharing CD image

2019-08-27 Thread Frediano Ziglio
Some updates to the series. Some minor styles updates. Big changes are the some rewrite of the USB emulation layer and the test which is now testing attach/detach properly. Frediano Ziglio (21): fixup! usb-redir: define interfaces to support emulated devices fixup! usb-redir: move implementati

[Spice-devel] [PATCH spice-gtk v4 04/29] fixup! usb-redir: move implementation of device description to USB backend

2019-08-27 Thread Frediano Ziglio
Really minor space removal --- src/usb-backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index aa11c791..252c0a64 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -845,8 +845,8 @@ spice_usb_backend_channel_get_guest_fi

[Spice-devel] [PATCH spice-gtk v4 06/29] usb-redir: extend USB backend to support emulated devices

2019-08-27 Thread Frediano Ziglio
From: Yuri Benditovich Redirection of emulated devices requires special approach, as usbredirhost can't be used for that (it works only with libusb devices). For emulated devices we create instance of usbredirparser that implements USB redirection protocol. In order to work with the same set of p

[Spice-devel] [PATCH spice-gtk v4 02/29] fixup! usb-redir: define interfaces to support emulated devices

2019-08-27 Thread Frediano Ziglio
Cosmetic style fixes --- src/usb-backend.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index de2b55ec..7f9fcc17 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -200,7 +200,7 @@ static int compare_dev_list_fi