[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.



Hi,

On 12/03/2009 04:05 PM, Chris Lumens wrote:
+        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.


Maybe just devices, like you call them later on. So then devices would get
partitioned into devices and raid_devices. or just call them non_multipath_devices,
which is long, but we only use it 2 times.


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
reliable?


I'm afraid not.

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


Right, which is the real problem.

Regards,

Hans


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