Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Development (http://www.linux-archive.org/debian-development/)
-   -   Adjust DeviceTree.isIgnored's handling of loop, ram, and live devices. (http://www.linux-archive.org/debian-development/497255-adjust-devicetree-isignoreds-handling-loop-ram-live-devices.html)

David Lehman 03-04-2011 05:45 PM

Adjust DeviceTree.isIgnored's handling of loop, ram, and live devices.
 
The change to include loop, ram, and live image devices in the
devicetree broke isIgnored when device filtering is used.

Related: rhbz#681608
---
pyanaconda/storage/devicetree.py | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 8054a2d..46394d5 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -550,9 +550,20 @@ class DeviceTree(object):

# never ignore mapped disk images. if you don't want to use them,
# don't specify them in the first place
- if udev_device_is_dm_anaconda(info):
+ if udev_device_is_dm_anaconda(info) or udev_device_is_dm_livecd(info):
return False

+ # Ignore loop and ram devices, we normally already skip these in
+ # udev.py: enumerate_block_devices(), but we can still end up trying
+ # to add them to the tree when they are slaves of other devices, this
+ # happens for example with the livecd
+ if name.startswith("ram"):
+ return True
+
+ if name.startswith("loop"):
+ # ignore loop devices unless they're backed by a file
+ return (not devicelibs.loop.get_backing_file(name))
+
# We want exclusiveDisks to operate on anything that could be
# considered a directly usable disk, ie: fwraid array, mpath, or disk.
#
@@ -570,17 +581,6 @@ class DeviceTree(object):
self.addIgnoredDisk(name)
return True

- # Ignore loop and ram devices, we normally already skip these in
- # udev.py: enumerate_block_devices(), but we can still end up trying
- # to add them to the tree when they are slaves of other devices, this
- # happens for example with the livecd
- if name.startswith("ram"):
- return True
-
- if name.startswith("loop"):
- # ignore loop devices unless they're backed by a file
- return (not devicelibs.loop.get_backing_file(name))
-
# FIXME: check for virtual devices whose slaves are on the ignore list

def addUdevLVDevice(self, info):
--
1.7.3.5

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


All times are GMT. The time now is 05:09 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.