After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 143888 - API changes for handling hotpluggable and removable storage
API changes for handling hotpluggable and removable storage
Status: RESOLVED OBSOLETE
Product: gnome-vfs
Classification: Deprecated
Component: Other
cvs (head)
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2004-06-07 18:11 UTC by David Zeuthen (not reading bugmail)
Modified: 2006-01-24 12:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Zeuthen (not reading bugmail) 2004-06-07 18:11:16 UTC
Whilst integrating freedesktop HAL into the volume monitor daemon of gnome-vfs
I've come across a few deficiencies in the API. 

There appears to be a one-to-one correspondance between GnomeVFSDrive and
GnomeVFSVolume objects that probably stems from the current detection code e.g.
reading and monitoring /etc/fstab and /etc/mtab ish files. Further, a
GnomeVFSDrive expects a mount point (through the activation URI) and a block
device that is a partition, e.g. /dev/sda1.

In order to support hardware where polling (the kernel won't poll for us, check
linux-hotplug and linux-kernel archives from Q1 2004) for media doesn't work
(try a Compact Flash 16-bit PCMCIA reader on a Linux 2.6.6 kernel for instance),
it is proposed to change GnomeVFSDrive such that it accepts a top-level block
device, e.g. /dev/sda. 

When activating this top-level block device (clicking on it in Nautilus for
instance) gnome-vfs should poll for media (effectively a 'blockdev --rereadpt
/dev/sda') and then the partitions will appear through a hotplug mechanism and
middleware, like HAL or updfstab(1) will create /etc/fstab.

Second, there should be a 1 to many (where many is 0, 1, 2, ...) relationship
between GnomeVFSDrive and GnomeVFSVolume as one top-level block device may have
several partitions embedded.

I'm not sure what the implications for the UI in Nautilus will be (consider
plugging a Compact Flash card with two partitions into a card reader and then
clicking on the drive representing the card reader; now two volumes will appear
and will the drive go away?) or whether this API change could be backwards
compatible.

Please advise, Thanks,
David
Comment 1 David Zeuthen (not reading bugmail) 2004-07-13 09:33:48 UTC
When activating a top-level block device it's not enough for gnome-vfs to do a
'blockdev --rereadpt /dev/sda' as I wrote above.

This is because the drive may contain media without a partition. In HAL we
should introduce a method call Rescan() on each org.freedesktop.Hal.Device
object that for storage devices has the semantics of polling for media. For
other devices (e.g. serial ports) the semantics may be different. 

We should extend D-BUS such that only trusted binaries (e.g.
/usr/libexec/gnome-vfs-daemon) can invoke this method (this is not related to
this bug but I'm noting it here so I don't forget).
Comment 2 David Zeuthen (not reading bugmail) 2006-01-24 12:51:14 UTC
I think we can close this one now...