Re: [spice-gtk 4/9] usb-redir: device description for emulated devices

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

 



Hi,

On Wed, Jul 24, 2019 at 01:53:46PM +0300, Yuri Benditovich wrote:
> Ability to retrieve device description for emulated USB
> device, defined by implementation. For example, for shared
> CD the implementation may use basename of ISO file.
> 
> Signed-off-by: Yuri Benditovich <yuri.benditovich@xxxxxxxxxx>
> ---
>  src/usb-device-manager.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> index b11bb15..1660905 100644
> --- a/src/usb-device-manager.c
> +++ b/src/usb-device-manager.c
> @@ -1483,11 +1483,18 @@ gchar *spice_usb_device_get_description(SpiceUsbDevice *device, const gchar *for
>          return g_strdup(_("USB redirection"));
>      }
>  
> +    if (!format)
> +        format = _("%s %s %s at %d-%d");
> +

We should add {} here as well, but patch is fine
Acked-by: Victor Toso <victortoso@xxxxxxxxxx>

>      bus     = spice_usb_device_get_busnum(device);
>      address = spice_usb_device_get_devaddr(device);
>      vid     = spice_usb_device_get_vid(device);
>      pid     = spice_usb_device_get_pid(device);
>  
> +    if (bus == BUS_NUMBER_FOR_EMULATED_USB) {
> +        return spice_usb_backend_device_description(device->bdev, format);
> +    }
> +
>      if ((vid > 0) && (pid > 0)) {
>          descriptor = g_strdup_printf("[%04x:%04x]", vid, pid);
>      } else {
> @@ -1497,9 +1504,6 @@ gchar *spice_usb_device_get_description(SpiceUsbDevice *device, const gchar *for
>      spice_usb_util_get_device_strings(bus, address, vid, pid,
>                                        &manufacturer, &product);
>  
> -    if (!format)
> -        format = _("%s %s %s at %d-%d");
> -
>      description = g_strdup_printf(format, manufacturer, product, descriptor, bus, address);
>  
>      g_free(manufacturer);
> -- 
> 2.17.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel

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]