[Spice-devel] [spice-gtk 04/13] usb-redir: do not add device if one with the same bus:addr exists

Christophe Fergeau cfergeau at redhat.com
Wed Mar 13 08:17:38 UTC 2019


On Wed, Mar 13, 2019 at 09:40:14AM +0200, Yuri Benditovich wrote:
> On Mon, Mar 11, 2019 at 7:17 PM Christophe Fergeau <cfergeau at redhat.com> wrote:
> >
> > On Sun, Mar 10, 2019 at 04:46:03PM +0200, Yuri Benditovich wrote:
> > > In initial device enumeration hotplug notification can be
> > > called twice with the same libusb device. For details, see
> > > http://libusb.sourceforge.net/api-1.0/group__libusb__hotplug.html#ga00e0c69ddf1fb1b6774dc918192e8dc7
> > > Filter out devices that already present in the list.
> > > Remove indentical call in spice_usb_device_manager_add_udev,
> > > which add devices under Windows.
> > >
> > > Signed-off-by: Yuri Benditovich <yuri.benditovich at daynix.com>
> > > ---
> > >  src/usb-device-manager.c | 22 +++++++++++-----------
> > >  1 file changed, 11 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
> > > index debba4d..5cf7ebb 100644
> > > --- a/src/usb-device-manager.c
> > > +++ b/src/usb-device-manager.c
> > > @@ -962,6 +962,17 @@ static void spice_usb_device_manager_add_dev(SpiceUsbDeviceManager  *self,
> > >      if (desc.bDeviceClass == LIBUSB_CLASS_HUB)
> > >          return;
> > >
> > > +    if (spice_usb_device_manager_find_device(self,
> > > +                                    libusb_get_bus_number(libdev),
> > > +                                    libusb_get_device_address(libdev))) {
> >
> > Forgot to mention that indentation is slightly off.
> 
> Please refer exact rule in coding conventions which explains how many
> spaces should be inserted to make you think the indentation is ideal.

I don't know if this is mentioned in a coding style document or not, but
aligning with the opening ( is what is done in most of the file.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190313/c2efb702/attachment.sig>


More information about the Spice-devel mailing list