GNOME Bugzilla – Bug 793925
Ignore unsupported devices
Last modified: 2018-03-01 16:36:25 UTC
.
Created attachment 369104 [details] [review] mtp: Fix warning to include interesting information This warning is not interesting at all: GVFS-MTP-WARNING **: device (null) has no BUSNUM property, ignoring If there's no BUSNUM, there might not be a device file either, which makes the problematic device impossible to pinpoint. Print the sysfs path instead, which will always be filled in.
Created attachment 369105 [details] [review] mtp: Ignore unsupported devices Devices which don't have either of BUSNUM or DEVNUM properties, but have ID_MTP_DEVICE tags usually are children devices of the main MTP device. Ignore them silently rather than throwing warnings in the journal.
Review of attachment 369104 [details] [review]: Can't we ignore all devices without device file in on_uevent at all instead of this? Seems that mtp/gphoto2 backends rely on device files anyway... This definitely needs fixes also for gphoto2 monitor, which contains more-or-less the same code.
Created attachment 369140 [details] [review] gphoto2: Ignore devices without a device file If there's no device file, which means libusb won't be able to open the device, no need to print a warning, simply ignore the device.
Created attachment 369141 [details] [review] mtp: Ignore devices without a device file If there's no device file, which means libusb won't be able to open the device, no need to print a warning, simply ignore the device.
Review of attachment 369140 [details] [review]: Looks ok, just... ::: monitor/gphoto2/ggphoto2volumemonitor.c @@ +160,3 @@ usb_bus_num = g_udev_device_get_property (device, "BUSNUM"); if (usb_bus_num == NULL) { + g_warning("device %s has no BUSNUM property, ignoring", device_path); ...please also fix the coding style in those lines (replace tabs by spaces, add missing space before parenthesis...).
Review of attachment 369141 [details] [review]: Looks ok, thanks!
Created attachment 369151 [details] [review] gphoto2: Ignore devices without a device file If there's no device file, which means libusb won't be able to open the device, no need to print a warning, simply ignore the device.
Attachment 369141 [details] pushed as 7a6fd7b - mtp: Ignore devices without a device file Attachment 369151 [details] pushed as 9762917 - gphoto2: Ignore devices without a device file