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 <[email protected]> > --- > 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 <[email protected]>
> 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
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/spice-devel
