Re: Automounting GVFS systems when devices are added?



On Tue, 2008-10-14 at 12:24 +0200, Alexander Larsson wrote:
> > I think it's more logical to use the same scheme as the gphoto2 backend,
> > e.g. afc://[usb:001,002] with bus and device number. The serial number
> > should probably be exported through both G_VOLUME_IDENTIFIER_KIND_UUID
> > and g_mount_get_uuid() [1].
> 
> I agree. It makes it easy to "resolve" the uri, without having to
> enumerate all the iphones on the usb bus.

Yeah. But the problem is that such URI's are not really suitable to be
used as bookmarks. Also, they screw up the thumbnail cache since that
keys off the URI meaning we have to rethumbnail all the files on
subsequent plug-ins. 

So a general rule of thumb, I think, is that we should really strive to
making sure the URIs we pass around a stable, I'm currently working on
fixing that for things we discover on the network, see #555436. When we
get around to writing docs for backend authors, we probably want to
emphasize that.

Anyway, down the road we should probably fix the gphoto2 (and afc when
that lands) backends to pass something like the USB device serial
number. FWIW, device enumeration is not a really problem, it should all
be cached in modern kernels anyway (see /sys/bus/usb/devices on Linux
2.6). Also, it's not unlikely we're going to have a DeviceKit-usb daemon
or something at some point that can cache things on it's own and provide
a simple D-Bus interface for looking up devices by serial number [1].

But for now, let's just use [usb:<bus>:<device>].

     David

[1]: I have some vague ideas on how a system-wide USB daemon might solve
the "only one opener per device" so multiple processes may access an USB
device. Still needs some research.




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