Re: [Spice-devel] [spice-gtk 8/9] usb-redir: add implementation of emulated CD device

2019-07-30 Thread Yuri Benditovich
On Tue, Jul 30, 2019 at 4:59 PM Frediano Ziglio wrote: > > > > > On Tue, Jul 30, 2019 at 1:43 PM Frediano Ziglio wrote: > > > > > > > > > > > This module contains implementation of emulated device > > > > interface for shared CD. > > > > > > > > Signed-off-by: Yuri Benditovich > > > > --- > > >

Re: [Spice-devel] [spice-gtk 8/9] usb-redir: add implementation of emulated CD device

2019-07-30 Thread Frediano Ziglio
> > On Tue, Jul 30, 2019 at 1:43 PM Frediano Ziglio wrote: > > > > > > > > This module contains implementation of emulated device > > > interface for shared CD. > > > > > > Signed-off-by: Yuri Benditovich > > > --- > > > src/usb-device-cd.c | 794 > >

Re: [Spice-devel] [PATCH spice-gtk 00/44] Follow ups for CD emulation patch series

2019-07-30 Thread Frediano Ziglio
> > May be you have these fixups on some branch on gitlab? > Sure, https://gitlab.freedesktop.org/fziglio/spice-gtk/tree/yuri_ci (remove the "REMOVE ME" ones). > On Tue, Jul 30, 2019 at 3:03 PM Frediano Ziglio wrote: > > > > Wrote some follow ups for CD emulation series. > > Some are just styl

Re: [Spice-devel] [PATCH spice-gtk 00/44] Follow ups for CD emulation patch series

2019-07-30 Thread Yuri Benditovich
May be you have these fixups on some branch on gitlab? On Tue, Jul 30, 2019 at 3:03 PM Frediano Ziglio wrote: > > Wrote some follow ups for CD emulation series. > Some are just style updates (spacing and indentations), some > minor comments, some interface improvements, some small fixes. > Beside

Re: [Spice-devel] [spice-gtk 8/9] usb-redir: add implementation of emulated CD device

2019-07-30 Thread Yuri Benditovich
On Tue, Jul 30, 2019 at 1:43 PM Frediano Ziglio wrote: > > > > > This module contains implementation of emulated device > > interface for shared CD. > > > > Signed-off-by: Yuri Benditovich > > --- > > src/usb-device-cd.c | 794 > > 1 file changed, 794

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

2019-07-30 Thread Frediano Ziglio
Use GLib string formatting syntax to fix a warning on Windows --- 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 7ef5bca4..ba8e1bff 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -375,7 +375

[Spice-devel] [PATCH spice-gtk 41/44] usb-redir: enable redirection of emulated CD drive

2019-07-30 Thread Frediano Ziglio
From: Yuri Benditovich Register constructor for emulated CD device. Now creation of CD devices at startup is possible. Signed-off-by: Yuri Benditovich --- src/meson.build | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/meson.build b/src/meson.build index b275da65..4bab087d 100644

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

2019-07-30 Thread Frediano Ziglio
Use proper type for UsbCdBulkMsdDevice pointer, more type safe. --- src/usb-device-cd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c index ba8e1bff..cda6ca3e 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -78,7 +78,7 @

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

2019-07-30 Thread Frediano Ziglio
--- src/usb-device-cd.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c index a2298b80..7ef5bca4 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -46,8 +46,7 @@ #include "usb-device-cd.h" #include "cd-usb-b

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

2019-07-30 Thread 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 +17,7 @@ variables: DEPS_MINGW: mingw64-gcc mingw64-pkg-config mingw64-pixman mingw64-openssl

[Spice-devel] [PATCH spice-gtk 42/44] usb-redir: Prepare for creation of emulated CD drive

2019-07-30 Thread Frediano Ziglio
From: Yuri Benditovich Added command-line option for shared CD devices and respective property in usb-device-manager. Signed-off-by: Yuri Benditovich --- src/spice-option.c | 15 +++ src/usb-device-manager.c | 35 +++ 2 files changed, 50 insert

[Spice-devel] [PATCH spice-gtk 43/44] CI: Add --werror

2019-07-30 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 37/44] fixup! usb-redir: add implementation of emulated CD device

2019-07-30 Thread Frediano Ziglio
Fix indentation of some declaration --- 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 e48236b4..a2298b80 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -558,7 +558,7 @@ static void usb_cd_b

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

2019-07-30 Thread Frediano Ziglio
param field was removed from parameters, read from device. --- src/usb-device-cd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c index a76ea43e..bc1c60d3 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -736,6 +736,7

[Spice-devel] [PATCH spice-gtk 30/44] usb-redir: add implementation of emulated CD device

2019-07-30 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 | 794 1 file changed, 794 insertions(+) create mode 100644 src/usb-device-cd.c diff --g

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

2019-07-30 Thread Frediano Ziglio
Rename delete to unrealize as discussed on ML. --- 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 18dbcea8..78e8f408 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -400,7 +400,7 @@ static gb

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

2019-07-30 Thread Frediano Ziglio
Use g_clear_object where possible --- src/usb-device-cd.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/usb-device-cd.c b/src/usb-device-cd.c index 9554a82f..e48236b4 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -131,8 +131,7 @@ static i

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

2019-07-30 Thread Frediano Ziglio
Update to new usb-backend interface. --- src/usb-device-cd.c | 47 + src/usb-device-cd.h | 37 +++ 2 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 src/usb-device-cd.h diff --git a/src/usb-device-cd.

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

2019-07-30 Thread Frediano Ziglio
Improve is_device_name for Windows. --- 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 bc1c60d3..9554a82f 100644 --- a/src/usb-device-cd.c +++ b/src/usb-device-cd.c @@ -194,8 +194,8 @@ static int cd_device

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

2019-07-30 Thread Frediano Ziglio
Use GLib string formatting syntax to fix a warning on Windows --- src/usb-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index cf1ae2b8..9753ba30 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -869,7 +869,7 @@ static v

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

2019-07-30 Thread Frediano Ziglio
Better check of cmd_len, avoids possible overflow or failing asserts, specification state that range should be 1-16. --- src/cd-usb-bulk-msd.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c index ab6644f3..95365163 100644 ---

[Spice-devel] [PATCH spice-gtk 12/44] usb-redir: device error signal without device object

2019-07-30 Thread Frediano Ziglio
From: Yuri Benditovich Add ability to indicate error to external modules via 'device error' signal when real SpiceUsbDevice is not passed. This is needed to indicate error during creation of emulated device, when the device is not created yet. For that we allocate temporary SpiceUsbDevice structu

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

2019-07-30 Thread Frediano Ziglio
Reuse MIN macro from GLib. --- src/cd-usb-bulk-msd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c index bb49e0d4..843f4f2e 100644 --- a/src/cd-usb-bulk-msd.c +++ b/src/cd-usb-bulk-msd.c @@ -354,7 +354,7 @@ static void usb_cd_send

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

2019-07-30 Thread Frediano Ziglio
Add some comments to code --- src/cd-usb-bulk-msd.c | 4 1 file changed, 4 insertions(+) diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c index 41e210f0..61c15a75 100644 --- a/src/cd-usb-bulk-msd.c +++ b/src/cd-usb-bulk-msd.c @@ -44,6 +44,7 @@ typedef enum UsbCdState { USB_CD_

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

2019-07-30 Thread Frediano Ziglio
Improve a header comment --- src/cd-scsi.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cd-scsi.h b/src/cd-scsi.h index 0b6ab9c1..65242444 100644 --- a/src/cd-scsi.h +++ b/src/cd-scsi.h @@ -109,8 +109,10 @@ int cd_scsi_dev_reset(CdScsiTarget *scsi_target, uint32_t

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

2019-07-30 Thread Frediano Ziglio
Remove data_buf leak. --- src/cd-usb-bulk-msd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c index 843f4f2e..41e210f0 100644 --- a/src/cd-usb-bulk-msd.c +++ b/src/cd-usb-bulk-msd.c @@ -129,6 +129,7 @@ UsbCdBulkMsdDevice *cd_usb_bulk_msd_alloc(

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

2019-07-30 Thread Frediano Ziglio
Use constructor to initialize structure, avoid multiple calls to cd_scsi_cmd_names_init and a variable. --- src/cd-scsi.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/cd-scsi.c b/src/cd-scsi.c index 9963762f..2a3595bb 100644 --- a/src/cd-scsi.c +++ b/src/cd-s

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

2019-07-30 Thread Frediano Ziglio
Fix typo in comment. --- src/cd-usb-bulk-msd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c index 89e94f8e..bb49e0d4 100644 --- a/src/cd-usb-bulk-msd.c +++ b/src/cd-usb-bulk-msd.c @@ -370,7 +370,7 @@ static void usb_cd_send_data_

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

2019-07-30 Thread Frediano Ziglio
Use sizeof instead of constant. --- src/cd-usb-bulk-msd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c index 61c15a75..ab6644f3 100644 --- a/src/cd-usb-bulk-msd.c +++ b/src/cd-usb-bulk-msd.c @@ -264,7 +264,7 @@ static int parse_u

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

2019-07-30 Thread Frediano Ziglio
Limit lines to 100 characters. --- src/cd-scsi.c | 48 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/cd-scsi.c b/src/cd-scsi.c index 39692576..9963762f 100644 --- a/src/cd-scsi.c +++ b/src/cd-scsi.c @@ -52,7 +52,8 @@ typedef st

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

2019-07-30 Thread Frediano Ziglio
Remove some constant from headers, put in the implementation --- src/cd-scsi.c | 3 +++ src/cd-scsi.h | 4 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cd-scsi.c b/src/cd-scsi.c index b35dad57..715fe1c6 100644 --- a/src/cd-scsi.c +++ b/src/cd-scsi.c @@ -32,6 +32,9 @@ #d

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

2019-07-30 Thread Frediano Ziglio
Some style updates: - structure; - comments; - C99 identifiers --- src/cd-scsi-dev-params.h | 15 +++- src/cd-scsi.c| 26 + src/cd-scsi.h| 15 +++- src/cd-usb-bulk-msd.c| 13 +++ src/cd-usb-bulk-msd.h| 79 -

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

2019-07-30 Thread Frediano Ziglio
Use proper type for CdScsiTarget and UsbCdBulkMsdDevice using forward declarations, no reasons to hide. Avoids useless casts and improve type safety. --- src/cd-scsi.c | 46 ++- src/cd-scsi.h | 30 src/cd-usb-bulk

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

2019-07-30 Thread Frediano Ziglio
Rename spice_usb_backend_create_device. Make clear is allocating an emulated device. --- src/usb-backend.c | 8 src/usb-emulation.h | 8 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index aa843465..a6c7b199 100644 --- a/sr

[Spice-devel] [PATCH spice-gtk 14/44] usb-redir: extend USB backend to support emulated devices

2019-07-30 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 10/44] fixup! usb-redir: define interfaces to support emulated devices

2019-07-30 Thread Frediano Ziglio
Rename delete to unrealize as discussed on ML --- src/usb-backend.c | 2 +- src/usb-emulation.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index 75ce12ba..aa843465 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -545,7 +

[Spice-devel] [PATCH spice-gtk 13/44] usb-redir: do not use spice_usb_acl_helper for emulated devices

2019-07-30 Thread Frediano Ziglio
From: Yuri Benditovich Signed-off-by: Yuri Benditovich --- 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 --- a/src/channel-usbredir.c ++

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

2019-07-30 Thread Frediano Ziglio
Remove circular dependency in usb emulation interface Allows to add or remove usb emulations without changing the backend --- src/usb-backend.c | 49 - src/usb-backend.h | 28 -- src/usb-emulation.h | 21 ++- 3

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

2019-07-30 Thread Frediano Ziglio
Unify spice_usb_device_get_description and spice_usb_backend_device_description They were doing the same thing. This make spice_usb_backend_device_description more consistent supporting any device, not only emulated --- src/usb-backend.c| 42 +++- src/us

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

2019-07-30 Thread Frediano Ziglio
Remove useless device_type, name is misleading and used only to understand if is emulated. This can be checked verifying bus number. bus number is 16 bits so use G_MAXUINT16 instead of 255 --- src/usb-backend.c | 1 - src/usb-backend.h | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) d

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

2019-07-30 Thread Frediano Ziglio
Remove unneeded address field from UsbCreateDeviceParameters --- src/usb-backend.c | 1 - src/usb-backend.h | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index a447bbfe..eb228e88 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -925,7 +925,6 @

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

2019-07-30 Thread Frediano Ziglio
Initialise SpiceUsbBackendDevice fields earlier Allows to use spice_usb_backend_device_unref and read some information directly from the device. --- src/usb-backend.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index 0b

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

2019-07-30 Thread Frediano Ziglio
Free libusb_device and edev anyway, even if they should be exclusively set --- src/usb-backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index ec0ae3e8..0b37274e 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -543,7 +54

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

2019-07-30 Thread Frediano Ziglio
Style --- src/usb-backend.c | 17 +++-- src/usb-emulation.h | 8 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index 0bf2eccf..f07009ad 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -197,7 +197,7 @@ static

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

2019-07-30 Thread Frediano Ziglio
Add some comments --- src/usb-backend.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/usb-backend.c b/src/usb-backend.c index f07009ad..ec0ae3e8 100644 --- a/src/usb-backend.c +++ b/src/usb-backend.c @@ -47,6 +47,8 @@ struct _SpiceUsbBackendDevice { +/* Poin

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

2019-07-30 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 00/44] Follow ups for CD emulation patch series

2019-07-30 Thread Frediano Ziglio
Wrote some follow ups for CD emulation series. Some are just style updates (spacing and indentations), some minor comments, some interface improvements, some small fixes. Beside that series is not far from the original sent one week ago. Added some minor patches for the CI to help catching some iss

Re: [Spice-devel] [spice-gtk 8/9] usb-redir: add implementation of emulated CD device

2019-07-30 Thread Frediano Ziglio
> > This module contains implementation of emulated device > interface for shared CD. > > Signed-off-by: Yuri Benditovich > --- > src/usb-device-cd.c | 794 > 1 file changed, 794 insertions(+) > create mode 100644 src/usb-device-cd.c > > diff --git