[patch] Add advisory locks to HAL devices
david at fubar.dk
Sun Sep 19 09:50:41 PDT 2004
On Wed, 2004-09-15 at 17:56 -0400, Joe Shaw wrote:
> On Sun, 2004-09-12 at 20:24 +0200, David Zeuthen wrote:
> > Very cool, I just played around with it and it looks good. The only real
> > comment I have is that the Lock() method shouldn't return anything and
> > instead just throw an exception if the device is already locked.
> > Right now it returns either TRUE or [FALSE, reason] which is a bit
> > difficult to catch when using language bindings.
> Okay, fixed all these things in this current patch. I couldn't test the
> spec stuff, though... I've never been able to get it to build.
Cool, I just add examples/locking.py and added the info.locked.*
properties to the spec.
In fact, this will be very useful as it solves the problem of g-v-m
popping up a burn:/// Nautilus window when nautilus-cd-burner is asking
me to insert a disc. Hence, n-c-b should just lock the hal device object
representing the drive and g-v-m shouldn't do any policy stuff on locked
So, I've put this into the spec in the "Enforcing Policy" section:
Policy agents like volume mounters should ignore when media is
inserted into a drive that is locked by another application.
Thus, CD burning applications should lock the device to disable
auto mounting or automatic start of the users preferred CD
burning application when respectively non-blank rewritable or
blank media is inserted.
Great work Joe! Thanks,
hal mailing list
hal at freedesktop.org
More information about the Hal