How to find out that several devices belong to each other?
David Zeuthen
david at fubar.dk
Sat Jul 22 08:30:03 PDT 2006
Hi,
Sorry for the lag,
On Wed, 2006-07-12 at 20:29 +0200, Fabian Steiner wrote:
> Hello!
>
> First of all, I would like to point that I does not have many experience
> in using HAL/DBus so far. So please forgive me if this question sounds
> stupid:
>
> When I plug in a USB-Stick, `lshal --monitor` gives me the follwing output:
>
> usb_device_781_5150_SNDK13DDF52557207702 added
> usb_device_781_5150_SNDK13DDF52557207702_if0 added
> usb_device_781_5150_SNDK13DDF52557207702_usbraw added
> usb_device_781_5150_SNDK13DDF52557207702_if0_scsi_host added
> usb_device_781_5150_SNDK13DDF52557207702_if0_scsi_host_scsi_device_lun0
> added
> usb_device_781_5150_SNDK13DDF52557207702_if0_scsi_host_scsi_device_lun0_scsi_generic
> added
> storage_serial_SanDisk_Cruzer_Mini_SNDK13DDF52557207702 added
> volume_uuid_3B69_1AFD added
>
> Obviously, more than device is created, but how can I find out that they
> all belong to the same physical device in fact. I need this information
> since I am currently working on a python application which depends on
> this thing.
So, that sure is a lot of devices but I'm not really sure they're all
interesting. For example, the SCSI host and SCSI device are
implementation details of the usb-storage driver on Linux 2.6 and just
provide glue. Oh, and if you use the 'ub' driver on Linux instead then
there is no SCSI glue. Or if you run on Solaris or FreeBSD it may look
different
The interesting objects, however, are
usb_device_781_5150_SNDK13DDF52557207702
usb_device_781_5150_SNDK13DDF52557207702_if0 added
storage_serial_SanDisk_Cruzer_Mini_SNDK13DDF52557207702
volume_uuid_3B69_1AFD
and the HAL spec guarantees you can get the relationship of these via
the following properties:
block.storage_device
storage.physical_device
and the fact that every USB interface is a child of the USB device (via
info.parent; maybe we should have a usb.enclosing_device property).
I don't really think the other objects are interesting at all? Maybe you
can shed some light on what application you're building?
Cheers,
David
More information about the hal
mailing list