Re: [Spice-devel] [spice-gtk Win32 v4 00/17] usbredir support for Windows (mingw)

2012-07-05 Thread Hans de Goede
Hi, I've reviewed all of the patches, I've comments to a few of them, see my individual replies to them. Overall the patchset looks good. Although I hope in the future we can get hotplug support at the libusb level, and hopefully more or less revert to the old situation where libusb_device == Spi

Re: [Spice-devel] [spice-gtk Win32 v4 06/17] Windows mingw: usb: Dynamically install a libusb driver for USB devices

2012-07-05 Thread Hans de Goede
Hi, On 07/05/2012 10:43 PM, Uri Lublin wrote: - Added win-usb-driver-install.[ch] - Added win-usb-clerk.h Operation (on Windows, spice-gtk point of view): - After some sanity checks, just before redir'ing a USB device a libusb driver needs to be installed (before libusb can open the device)

Re: [Spice-devel] [spice-gtk Win32 v4 03/17] Make SpiceUsbDevice a box for SpiceUsbDeviceInfo, instead of a box for libusb_device

2012-07-05 Thread Hans de Goede
Hi, On 07/05/2012 10:43 PM, Uri Lublin wrote: Note that this change may affect performance a bit, as sometimes there is a need to find the libusb_device or the SpiceUsbDevice. Likely it's negligible. --- gtk/channel-usbredir.c|2 +- gtk/usb-device-manager-priv.h | 10 ++- gtk/u

Re: [Spice-devel] [spice-gtk Win32 v4 02/17] Introduce SpiceUsbDeviceInfo to be kept instead of a libusb_device

2012-07-05 Thread Hans de Goede
Hi, Looking at the next patch in the series, I've one more remark on this one: On 07/05/2012 10:43 PM, Uri Lublin wrote: +static SpiceUsbDeviceInfo *spice_usb_device_set_info(libusb_device *libdev) +{ +SpiceUsbDeviceInfo *info; +struct libusb_device_descriptor desc; +int errcode; +

Re: [Spice-devel] [spice-gtk Win32 v4 02/17] Introduce SpiceUsbDeviceInfo to be kept instead of a libusb_device

2012-07-05 Thread Hans de Goede
Hi, On 07/05/2012 10:43 PM, Uri Lublin wrote: For Windows, it's better not to keep references for libusb_devices that are not used. So instead of makeing SpiceUsbDevice a box for a libusb_device it is going to be a box for a SpiceUsbDeviceInfo. --- gtk/usb-device-manager.c | 145 +

Re: [Spice-devel] [protocol] Add spice/Makefile to the generated .gitignore

2012-07-05 Thread Jeremy White
Okay, I wrote to Behdad Esfahbod, who rapidly and cheerfully fixed the upstream issue. Attached is the upstream patch. If applied to spice-protocol, then it should no longer be the case that a clone spice; ./autogen.sh; make; git status reports a dirty submodule. Cheers, Jeremy >From eb3a2db

Re: [Spice-devel] [spice-gtk Win32 v4 00/17] usbredir support for Windows (mingw)

2012-07-05 Thread Marc-André Lureau
Hi Thanks for the update, it would be nice if you could rebase, putting the trivial patch first, so we could ack them and any further iteration would have less patches. Or alternatively, send those patches as a seperate series if you prefer. This also makes diffing and bisecting a bit easier later

Re: [Spice-devel] [spice-gtk Win32 v4 06/17] Windows mingw: usb: Dynamically install a libusb driver for USB devices

2012-07-05 Thread Marc-André Lureau
Hi some remarks below On Thu, Jul 5, 2012 at 10:43 PM, Uri Lublin wrote: > @@ -635,7 +649,7 @@ static void > spice_usb_device_manager_add_dev(SpiceUsbDeviceManager *self, > spice_usb_device_manager_connect_device_async(self, > device, NULL, >

Re: [Spice-devel] [spice-gtk Win32 v4 03/17] Make SpiceUsbDevice a box for SpiceUsbDeviceInfo, instead of a box for libusb_device

2012-07-05 Thread Marc-André Lureau
On Thu, Jul 5, 2012 at 11:26 PM, Marc-André Lureau wrote: > On Thu, Jul 5, 2012 at 10:43 PM, Uri Lublin wrote: >> +gboolean filter_ok = FALSE; > > Actually, I think "auto_ok" was a more readable name here, since it > affects only the "auto" code path. > > -- > Marc-André Lureau +if (

Re: [Spice-devel] [spice-gtk Win32 v4 03/17] Make SpiceUsbDevice a box for SpiceUsbDeviceInfo, instead of a box for libusb_device

2012-07-05 Thread Marc-André Lureau
On Thu, Jul 5, 2012 at 10:43 PM, Uri Lublin wrote: > +gboolean filter_ok = FALSE; Actually, I think "auto_ok" was a more readable name here, since it affects only the "auto" code path. -- Marc-André Lureau ___ Spice-devel mailing list Spice-devel@

Re: [Spice-devel] [spice-gtk Win32 v4 02/17] Introduce SpiceUsbDeviceInfo to be kept instead of a libusb_device

2012-07-05 Thread Marc-André Lureau
On Thu, Jul 5, 2012 at 10:43 PM, Uri Lublin wrote: > +ref = atomic_dec(&info->ref); > +if (ref == 0) { > +memset(info, 0, sizeof(*info)); > +g_free(info); > +} we should really be using the g_atomic operations. g_atomic_int_dec_and_test () is idiomatic for unref (it ma

[Spice-devel] [spice-gtk Win32 v4 17/17] controller/test.c: mingw: fix compiler bad param warning for ReadFile

2012-07-05 Thread Uri Lublin
It seems that ssize_t is int, while DWORD is long Compiler warning (some whitespaces where added for readability): ../../../gtk/controller/test.c: In function 'read_from_pipe': ../../../gtk/controller/test.c:108:5: warning: passing argument 4 \ of 'ReadFile' from incompatible pointer ty

[Spice-devel] [spice-gtk Win32 v4 16/17] usb-device-manager: mingw: ignore "remove" udev event when un/installing a driver

2012-07-05 Thread Uri Lublin
--- gtk/usb-device-manager.c | 11 ++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index e032f24..3f0da77 100644 --- a/gtk/usb-device-manager.c +++ b/gtk/usb-device-manager.c @@ -718,6 +718,16 @@ static void spice_u

[Spice-devel] [spice-gtk Win32 v4 15/17] usb-device-manager: mingw: keep driver install/uninstall state of a device

2012-07-05 Thread Uri Lublin
Currently only driver install/unsinstall is of interest, such that extra udev events can be ignored. --- gtk/usb-device-manager.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index 1821c58..e032f24 100644 --- a/gtk

[Spice-devel] [spice-gtk Win32 v4 14/17] usb-device-manager: add 'state' field to SpiceUsbDeviceInfo

2012-07-05 Thread Uri Lublin
To be used on Win32 to ignore extra udev events received during driver install/uninstall. --- gtk/usb-device-manager.c | 37 + 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index b4bf7ac..18

[Spice-devel] [spice-gtk Win32 v4 13/17] usb-device-manager.c: add_dev: ignore already known devices

2012-07-05 Thread Uri Lublin
Sometimes on a Windows client, udev events are received while the driver is being un/installed. so just ignore it --- gtk/usb-device-manager.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index 53a3794..b4bf7ac

[Spice-devel] [spice-gtk Win32 v4 12/17] usb-device-manager: use find_device() in libdev_to_device()

2012-07-05 Thread Uri Lublin
--- gtk/usb-device-manager.c | 15 +-- 1 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index 3fec521..53a3794 100644 --- a/gtk/usb-device-manager.c +++ b/gtk/usb-device-manager.c @@ -1414,17 +1414,12 @@ static SpiceU

[Spice-devel] [spice-gtk Win32 v4 11/17] usb-device-manager: add a helper function to find a usb device

2012-07-05 Thread Uri Lublin
And use it in spice_usb_device_manager_remove_dev --- gtk/usb-device-manager.c | 32 +--- 1 files changed, 21 insertions(+), 11 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index d9ed8a7..3fec521 100644 --- a/gtk/usb-device-manager.c

[Spice-devel] [spice-gtk Win32 v4 10/17] Win32/mingw: win-usb-dev: skip hubs

2012-07-05 Thread Uri Lublin
also skip devices with bad (0) device-address. --- gtk/win-usb-dev.c | 26 -- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/gtk/win-usb-dev.c b/gtk/win-usb-dev.c index bc21e08..c188807 100644 --- a/gtk/win-usb-dev.c +++ b/gtk/win-usb-dev.c @@ -94,6 +94,8

[Spice-devel] [spice-gtk Win32 v4 09/17] Win32/mingw: usb-device-manager: uninstall win usb driver upon device disconnect

2012-07-05 Thread Uri Lublin
--- gtk/usb-device-manager.c | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index 224b7e8..d9ed8a7 100644 --- a/gtk/usb-device-manager.c +++ b/gtk/usb-device-manager.c @@ -727,6 +727,7 @@ typedef

[Spice-devel] [spice-gtk Win32 v4 08/17] win-usb-driver-install: add capability to remove (uninstall) a win usb driver

2012-07-05 Thread Uri Lublin
--- gtk/usb-device-manager.c | 17 +++--- gtk/win-usb-driver-install.c | 69 +- gtk/win-usb-driver-install.h |6 3 files changed, 66 insertions(+), 26 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index c

[Spice-devel] [spice-gtk Win32 v4 07/17] usb-device-manager: warn if a device to remove was not found

2012-07-05 Thread Uri Lublin
Also changed a bit the warning text on device-add to differentiate the two. --- gtk/usb-device-manager.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk/usb-device-manager.c b/gtk/usb-device-manager.c index 7d33511..c320fb8 100644 --- a/gtk/usb-device-manager.c

[Spice-devel] [spice-gtk Win32 v4 06/17] Windows mingw: usb: Dynamically install a libusb driver for USB devices

2012-07-05 Thread Uri Lublin
- Added win-usb-driver-install.[ch] - Added win-usb-clerk.h Operation (on Windows, spice-gtk point of view): - After some sanity checks, just before redir'ing a USB device a libusb driver needs to be installed (before libusb can open the device) - A connection (NamedPipe) is established with usb

[Spice-devel] [spice-gtk Win32 v4 05/17] Windows mingw: usb: implement GUdevDevice & GUdevClient for windows

2012-07-05 Thread Uri Lublin
From: Arnon Gilboa - Added win-usb-dev.[ch] - Added GUdevDevice and GUdevClient like classes - Added uevent signal based on WM_DEVICECHANGE --- gtk/Makefile.am | 13 ++ gtk/usb-device-manager.c |8 + gtk/win-usb-dev.c| 510 ++ g

[Spice-devel] [spice-gtk Win32 v4 04/17] Windows mingw: usb: configure.ac: do not require GUDEV for USBREDIR

2012-07-05 Thread Uri Lublin
For windows GUDEV is not required For Linux GUDEV is checked as a part of USBREDIR block, but as a separate check. --- configure.ac| 15 ++- gtk/Makefile.am |2 ++ 2 files changed, 16 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 09129b7..d928f

[Spice-devel] [spice-gtk Win32 v4 03/17] Make SpiceUsbDevice a box for SpiceUsbDeviceInfo, instead of a box for libusb_device

2012-07-05 Thread Uri Lublin
Note that this change may affect performance a bit, as sometimes there is a need to find the libusb_device or the SpiceUsbDevice. Likely it's negligible. --- gtk/channel-usbredir.c|2 +- gtk/usb-device-manager-priv.h | 10 ++- gtk/usb-device-manager.c | 188

[Spice-devel] [spice-gtk Win32 v4 02/17] Introduce SpiceUsbDeviceInfo to be kept instead of a libusb_device

2012-07-05 Thread Uri Lublin
For Windows, it's better not to keep references for libusb_devices that are not used. So instead of makeing SpiceUsbDevice a box for a libusb_device it is going to be a box for a SpiceUsbDeviceInfo. --- gtk/usb-device-manager.c | 145 ++ 1 files changed

[Spice-devel] [spice-gtk Win32 v4 01/17] spicy: more informative presentation of usb devices in menu

2012-07-05 Thread Uri Lublin
Using the default format. --- gtk/spicy.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gtk/spicy.c b/gtk/spicy.c index 98a44d5..5ffe3b7 100644 --- a/gtk/spicy.c +++ b/gtk/spicy.c @@ -460,7 +460,7 @@ static void menu_cb_select_usb_devices(GtkAction *action, void *data)

[Spice-devel] [spice-gtk Win32 v4 00/17] usbredir support for Windows (mingw)

2012-07-05 Thread Uri Lublin
New in V4: - Using g_win32_output_stream and g_win32_input_stream instead of our own named-pipe class. - Keeping SpiceUsbDevice as a BOX type, but making it hold a SpiecUsbDeviceInfo instead of a libusb_device. - Ignoring win-usb-dev (udev) events caused by driver install an

Re: [Spice-devel] [PATCH 1/4] server/red_worker: cleanup lines starting with 5 spaces

2012-07-05 Thread Marc-André Lureau
ack On Thu, Jul 5, 2012 at 6:42 PM, Alon Levy wrote: > --- > server/red_worker.c | 26 +- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/server/red_worker.c b/server/red_worker.c > index ef1b1b1..3092218 100644 > --- a/server/red_worker.c > +++ b/s

[Spice-devel] [PATCH 4/4] server/reds.c: spice_printerr cleanup

2012-07-05 Thread Alon Levy
Rules for replacing spice_printerr: * if it's a client drop / agent drop, spice_error * if it's important, spice_warning * else, spice_info. The fourth rule is spice_debug if it's going to fill up the log, but nothing of the sort here. Other things this patch does: * changed reds_show_new_channel

[Spice-devel] [PATCH 3/4] server/red_worker: elevate some spice_debugs to spice_info

2012-07-05 Thread Alon Levy
Specifically all those that the previous patch converted to spice_debug. spice_debug contains very verbose stuff like update_area that drowns out those relatively rare (client connect / disconnect generated) messages. --- server/red_worker.c | 104 +

[Spice-devel] [PATCH 2/4] update spice-common for spice_info

2012-07-05 Thread Alon Levy
--- spice-common |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spice-common b/spice-common index f8f6231..2449260 16 --- a/spice-common +++ b/spice-common @@ -1 +1 @@ -Subproject commit f8f6231ecdb99595a07e6c3933dedd7438ef4f1d +Subproject commit 2449260c81a6f5344214ee2

[Spice-devel] [PATCH 1/4] server/red_worker: cleanup lines starting with 5 spaces

2012-07-05 Thread Alon Levy
--- server/red_worker.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index ef1b1b1..3092218 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -6132,22 +6132,22 @@ static int red_jpeg_compres

Re: [Spice-devel] [PATCH spice-common] common/log.h: add spice_client_error

2012-07-05 Thread Alon Levy
On Thu, Jul 05, 2012 at 01:20:35PM +0200, Marc-André Lureau wrote: > Hi > > On Thu, Jul 5, 2012 at 1:17 PM, Alon Levy wrote: > > That doesn't allow me to have in the same compilation unit (red_worker.c) > > two > > domains. Also, you can't define macros with macros, so I'm not sure what > > bett

[Spice-devel] [PATCH spice-common] common/log.h: add spice_info

2012-07-05 Thread Alon Levy
--- common/log.h |6 ++ 1 file changed, 6 insertions(+) diff --git a/common/log.h b/common/log.h index 37c491f..d9e6023 100644 --- a/common/log.h +++ b/common/log.h @@ -85,6 +85,12 @@ void spice_log(const char *log_domain, } SPICE_STMT_END #endif +#ifndef spice_info +#define spice_inf

[Spice-devel] its posible to install spice client on HP t5556z

2012-07-05 Thread enzo
helo: you know if its posible to install spice client on HP t5556z.??? rhev 3 infraestructure thanks.enzo -- PRINCIPAT D'ANDORRA Email: e.aco...@lemcentral.com T

Re: [Spice-devel] [PATCH spice-common] common/log.h: add spice_client_error

2012-07-05 Thread Marc-André Lureau
Hi On Thu, Jul 5, 2012 at 1:17 PM, Alon Levy wrote: > That doesn't allow me to have in the same compilation unit (red_worker.c) two > domains. Also, you can't define macros with macros, so I'm not sure what > better way there is. I'd put the macro in red_worker.c in this case. And I wouldn't re

Re: [Spice-devel] [PATCH spice-common] common/log.h: add spice_client_error

2012-07-05 Thread Alon Levy
On Thu, Jul 05, 2012 at 01:10:44PM +0200, Marc-André Lureau wrote: > On Thu, Jul 5, 2012 at 11:38 AM, Alon Levy wrote: > > To be used to mark client protocol violations, more easily greppable. > > --- > > common/log.h | 11 +++ > > 1 file changed, 11 insertions(+) > > > > diff --git a/c

Re: [Spice-devel] [PATCH spice-common] common/log.h: add spice_client_error

2012-07-05 Thread Marc-André Lureau
On Thu, Jul 5, 2012 at 11:38 AM, Alon Levy wrote: > To be used to mark client protocol violations, more easily greppable. > --- > common/log.h | 11 +++ > 1 file changed, 11 insertions(+) > > diff --git a/common/log.h b/common/log.h > index 37c491f..df8a756 100644 > --- a/common/log.h >

Re: [Spice-devel] [PATCH spice-common] common/log.h: add spice_client_error

2012-07-05 Thread Hans de Goede
ACK. On 07/05/2012 11:38 AM, Alon Levy wrote: To be used to mark client protocol violations, more easily greppable. --- common/log.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/common/log.h b/common/log.h index 37c491f..df8a756 100644 --- a/common/log.h +++ b/common/log

Re: [Spice-devel] [PATCH] server/red_worker: death to spice_printerr, too verbose by far

2012-07-05 Thread Hans de Goede
ACk, +100 ! On 07/05/2012 11:38 AM, Alon Levy wrote: Replaced mostly with spice_debug, but spice_warning & spice_error as well where appropriate. --- server/red_worker.c | 182 +-- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a

[Spice-devel] [PATCH] server/red_worker: death to spice_printerr, too verbose by far

2012-07-05 Thread Alon Levy
Replaced mostly with spice_debug, but spice_warning & spice_error as well where appropriate. --- server/red_worker.c | 182 +-- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index c712180..

[Spice-devel] [PATCH spice-common] common/log.h: add spice_client_error

2012-07-05 Thread Alon Levy
To be used to mark client protocol violations, more easily greppable. --- common/log.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/common/log.h b/common/log.h index 37c491f..df8a756 100644 --- a/common/log.h +++ b/common/log.h @@ -28,6 +28,10 @@ SPICE_BEGIN_DECLS #define SP