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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 10, 2019 at 04:46:06PM +0200, Yuri Benditovich wrote:

Maybe the shortlog would be clearer as
"usb-redir: remove SpiceUsbDeviceManager::coldplug_list"

> Discard the optimization of initial device enumeration.
> Just after connection to 'udev' signal request to report

"... to the 'uevent' 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 <yuri.benditovich@xxxxxxxxxx>
> ---
>  src/usb-device-manager.c | 19 +++----------------
>  src/win-usb-dev.c        | 11 +++++++----
>  src/win-usb-dev.h        |  2 +-
>  3 files changed, 11 insertions(+), 21 deletions(-)
> 
> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> index 5cf7ebb..f7b43f0 100644
> --- a/src/usb-device-manager.c
> +++ b/src/usb-device-manager.c
> @@ -104,7 +104,6 @@ struct _SpiceUsbDeviceManagerPrivate {
>      int redirect_on_connect_rules_count;
>  #ifdef G_OS_WIN32
>      GUdevClient *udev;
> -    libusb_device **coldplug_list; /* Avoid needless reprobing during init */
>  #else
>      gboolean redirecting; /* Handled by GUdevClient in the gudev case */
>      libusb_hotplug_callback_handle hp_handle;
> @@ -307,15 +306,7 @@ static gboolean spice_usb_device_manager_initable_init(GInitable  *initable,
>      g_signal_connect(G_OBJECT(priv->udev), "uevent",
>                       G_CALLBACK(spice_usb_device_manager_uevent_cb), self);
>      /* Do coldplug (detection of already connected devices) */
> -    libusb_get_device_list(priv->context, &priv->coldplug_list);
> -    list = g_udev_client_query_by_subsystem(priv->udev, "usb");
> -    for (it = g_list_first(list); it; it = g_list_next(it)) {
> -        spice_usb_device_manager_add_udev(self, it->data);
> -        g_object_unref(it->data);
> -    }
> -    g_list_free(list);
> -    libusb_free_device_list(priv->coldplug_list, 1);
> -    priv->coldplug_list = NULL;
> +    g_udev_client_report_devices(priv->udev);

I think I would have gone with 'coldplug' or 'signal' instead of
'report" but that really is nitpicking


Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]