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

Re: [PATCH 11/14] Add an early user interface for filtering storage devices.

> +        all_devices = filter(udev_device_is_disk, udev_get_block_devices())
> +        (all_devices, mpaths, partitions) = identifyMultipaths(all_devices)
> +
> +        # The device list could be really long, so we really only want to
> +        # iterate over it the bare minimum of times.  Dividing this list up
> +        # now means fewer elements to iterate over later.
> +        (raid_devices, devices) = self.partition_list(lambda d: isRAID(d) and not isCCISS(d),
> +                                                      all_devices)
> Notice how the second line of this bit, overrides all_devices to just be non multipath
> disks, maybe it should then no longer be named all_devices? This confused me
> into thinking that the last line of the quoted bit operated on, well, all (block) devices.

Right, it becomes a problem of naming here.  What do you call the first
element in the tuple returned by identifyMultipaths?  devices?
simple_devices (they're not necessarily simple)?  basic_devices (they're
not necessarily basic)?

Something could probably be done here.

> Ok, well the above code then assumes that udev_device_get_format() will return
> the same for disks in a set, which it of course should, but I've sane cases where
> it would not (due to a broken BIOS not writing the correct metadata). Anyways in
> that case I think this is ok.

Can I get the same information somewhere else that's going to be more

Of course, nothing's really reliable where disks are concerned...

> >See:  http://www.standardml.org/Basis/list.html#SIG:LIST.partition:VAL
> >This is a fairly common name for a list functional in other languages.
> >I suppose I could change it if I have to.
> If this is a common name for such a function, then its fine to leave it
> as is, lets not turn this into a color of the bikeshed discussion :)

Meh, I can see how it'd be confusing.

- Chris

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