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

[PATCH 3/3] Unmount the image file



From: "Brian C. Lane" <bcl redhat com>

---
 anaconda                      |   10 ++++++++++
 pyanaconda/storage/devices.py |    2 +-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/anaconda b/anaconda
index 2056af3..d8e9de5 100755
--- a/anaconda
+++ b/anaconda
@@ -51,6 +51,16 @@ def exitHandler(anaconda, exitCode=None):
             while True:
                 time.sleep(10000)
 
+    if image_count:
+        anaconda.storage.umountFilesystems(ignoreErrors=True, swapoff=False)
+        devicetree = anaconda.storage.devicetree
+        devicetree.teardownAll()
+        for name in devicetree.diskImages:
+            device = devicetree.getDeviceByName(name)
+            for loop in device.parents:
+                loop.controllable = True
+            device.deactivate(recursive=True)
+
     if anaconda.ksdata and not flags.imageInstall:
         from pykickstart.constants import KS_SHUTDOWN, KS_WAIT, KS_REBOOT
 
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 15c3e49..dba00dc 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -1856,7 +1856,7 @@ class DMLinearDevice(DMDevice):
         udev_settle()
 
     def deactivate(self, recursive=False):
-        StorageDevice.teardown(self)
+        StorageDevice.teardown(self, recursive=recursive)
 
     def teardown(self, recursive=None):
         """ Close, or tear down, a device. """
-- 
1.7.6.4


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