raw device property

Artem Kachitchkine Artem.Kachitchkin at Sun.COM
Wed Mar 29 13:57:46 PST 2006


Soren Hansen wrote:
> On Wed, Mar 29, 2006 at 11:25:05AM -0800, Artem Kachitchkine wrote:
>> What I'm proposing is that "block.raw_device" be an *optional*, not
>> mandatory, property. If the system supports and/or configured with raw
>> devices, HAL can create this property; otherwise, it doesn't have to.
> 
>> As I said, the way this can be handled in a portable application is to 
>> check for "block.raw_device" first, and fall back to "block.device" is 
>> the former does not exist.
> 
> I don't agree. If you can treat the devices under Linux as raw devices,
> the proper thing to do would be to put the same value into both
> 'raw_device' and 'device'. However, on systems where you cannot treat
> the devices as raw devices, the raw_device attribute would of course be
> non-existant.

Yes, I considered this option.

One concern I have here is additional semantics: besides the primary 
function of pointing to the raw device, the existence/absense of this 
property could also be used to determine if raw devices are supported by 
the OS. Whether this is use or abuse depends on how reliable it is and 
can be. If we go with your suggestion, we are essentially mandating all 
existing and future HAL backends to reliably determine raw support in 
their OS.

Another concern is how portable applications are going to obtain raw 
access. When 'raw_device' != 'device', just opening 'raw_device' with 
the usual POSIX flags gives you raw access. When 'raw_device' == 
'device', one needs to supply additional flags, which might not exist on 
all OSes. HAL would need some way to express this, to keep application 
portable.

These two concerns led me to propose a less functional but safer 
alternative.

-Artem.



More information about the hal mailing list