devicekit-disks: media-available property
tpgww at onepost.net
tpgww at onepost.net
Wed Jun 3 17:36:36 PDT 2009
Hello all. I'm posting this here as advised by the devicekit-disks manpage, I hope that's still ok.
I've been playing with devicekit-disks 004, trying to figure out the best way to implement some fallback auto [un]mounting (i.e. when the DE etc doesn't do it properly).
Of the various device properties that are available, one convenient candidate is "device-is-media-available". But the daemon fails to register (or at least, report) a change when a disk is later inserted or removed. As an example, here's a dump from the command-line tool, incorrectly showing no media present:
[me at localhost ~]$ devkit-disks --show-info /dev/sr0
Showing information for /org/freedesktop/DeviceKit/Disks/devices/sr0
native-path: /sys/block/sr0
device: 11:0
device-file: /dev/sr0
by-path: /dev/disk/by-path/pci-0000:00:06.0-scsi-0:0:1:0
detected at: Thu 04 Jun 2009 09:59:33 EST
system internal: 0
removable: 1
has media: 0 <<<<<
detects change: 1
detection by polling: 1
detection inhibitable: 1
detection inhibited: 0
is read only: 0
is mounted: 1
mount paths: /media/cdrom
mounted by uid: 0
presentation hide: 0
presentation name:
presentation icon:
size: 0
block size: 0
job underway: no
usage:
type:
version:
uuid:
label:
drive:
vendor:
model:
revision:
serial:
ejectable: 0
require eject: 1
media:
compat: optical_cd optical_cd_r optical_cd_rw optical_dvd optical_mrw optical_mrw_w
interface: (unknown)
if speed: (unknown)
ATA SMART: not available
Alternatively, if a disk is present when the command is first run, the media is shown as present, but then continues to be so reported, after it's been removed.
The same sort of thing happens when I code to specifically interrogate the "device-is-media-available" property.
Any suggestions ?
Regards
Tom
More information about the hal
mailing list