[Spice-devel] [PATCH v3 03/13] GUdevClient: Do not process udb add/remove events if redirection in progress

Christophe Fergeau cfergeau at redhat.com
Tue Aug 11 03:52:47 PDT 2015


"usb" in the subject line
You need to explain why you don't want to do that while redirection is
in progress, either in the commit log, or in a code comment (I'd go with
a code comment as this is not obvious).
The code which calls handle_dev_change() in
spice_g_udev_set_redirecting() logically belongs here.


On Mon, Aug 03, 2015 at 04:10:43PM +0300, Kirill Moizik wrote:
> From: Kirill Moizik <kmoizik at redhat.com>
> 
> ---
>  src/win-usb-dev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/win-usb-dev.c b/src/win-usb-dev.c
> index 875ef89..c42273f 100644
> --- a/src/win-usb-dev.c
> +++ b/src/win-usb-dev.c
> @@ -360,6 +360,9 @@ static void handle_dev_change(GUdevClient *self)
>      GList *llist, *slist; /* long-list and short-list*/
>      GList *lit, *sit; /* iterators for long-list and short-list */
>      GUdevDevice *ldev, *sdev; /* devices on long-list and short-list */
> +    if (priv->redirecting == TRUE) {
> +        return;
> +    }
>  
>      dev_count = g_udev_client_list_devices(self, &now_devs, &err,
>                                             __FUNCTION__);
> -- 
> 2.4.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150811/e18a6b7d/attachment.sig>


More information about the Spice-devel mailing list