Re: [PATCH] Move setting of UUIDs into activate methods. (#584328)

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

 



 On 10/20/2010 05:57 AM, David Lehman wrote:
 Setting the UUIDs from __init__ means accessing self.map, which has the
 side-effect of creating the array's device node and setting self.active
 to True, which prevents subsequent calls to activate from creating the
 partitions' device nodes. We avoid this mess by setting the UUIDs only
 from within activate and only if mknod is True.
 ---
 device.py | 9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

 diff --git a/device.py b/device.py
 index 0bf0398..026c952 100644
 --- a/device.py
 +++ b/device.py
 @@ -322,8 +322,7 @@ class MultiPath:
 table = self.get_table()
 import dm as _dm

 - self._set_map_uuid(self.map)
 -
 + self.get_map()
 # this sets the refcount to 2 (undone by __deactivate__)
 nameCache.get(self.name)

 @@ -570,9 +569,8 @@ class MultiPath:
 self.map.dev.mknod(self.prefix+self.name)
 self.mknod = True

 - map = self.map
 + self._set_map_uuid(self.map)
 nameCache.get(self.name) # this should set the refcount to 2
 - del map

 self.removeMemberParts()
 self.buildParts()
 @@ -616,8 +614,6 @@ class RaidSet:
 self.active = False
 self.mknod = False

 - self._set_map_uuid(self.map)
 -
 def __cmp__(self, other):
 return cmp(self.map, other.map)

 @@ -841,6 +837,7 @@ class RaidSet:
 pass
 self.map.dev.mknod(self.prefix+self.name)
 self.mknod = True
 + self._set_map_uuid(self.map)

 self.removeMemberParts()
 if mkparts:

Ack.

--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
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