Re: [PATCH 3/3] Enhance drive specification for clearpart, ignoredisk, and partition.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2009-11-20 at 09:39 -0500, Chris Lumens wrote:
> > > +def deviceMatches(spec):
> > > +    matches = udev_resolve_glob(spec)
> > > +    dev = udev_resolve_devspec(spec)
> > > +
> > > +    # udev_resolve_devspec returns None if there's no match, but we don't
> > > +    # want that ending up in the list.
> > > +    if dev:
> > > +        matches.append(dev)
> > 
> > Shouldn't the above be something like 'if dev and dev not in matches:'
> > instead?
> 
> My thinking was that we should try both methods for resolving the spec
> we're given.  However, maybe there's no reason you'd ever get a glob
> that's also a valid disk name so I don't need to do this.

Makes sense.

> 
> > Also, about the udev_trigger... it would be nice if we could only do
> > that as often as is really necessary, especially for larger systems, but
> > that probably doesn't rank very high among our other sins.
> 
> Agreed.  I wonder if we can get away with doing this only once early on.
> Alternatively, we could do some sort of caching thing like so:
> 
> _triggerCache = {}
> def udev_trigger(subsystem=None, action="add"):
>    global _triggerCache
>    if _triggerCache.has_key(subsystem):
>       return
> 
>    ...
>    iutil.execWithRedirect(...)
>    _triggerCache.setdefault(subsystem)
> 
> However, this is entirely too much like the old driveDict out of isys
> that we always had so many problems with.  I don't really like it.

I don't like it either. The thing is that we might want to skip the
initial trigger in storageInitialize in the kickstart case the first
time through, but we do want to do the trigger in any subsequent calls
to storageInitialize so that the database is updated before we start
looking for stuff. So it looks like, at worst, one extra call. Oh, well.

Dave

> 
> - Chris
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux