Re: [PATCH 5/5] prevent getting started up or shutdown again while already in such state

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks good, applying to master.

On Fri, 10 Jul 2009, Steffen Maier wrote:

Essential with all the correct error handling in place.
---
storage/zfcp.py |    9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/storage/zfcp.py b/storage/zfcp.py
index 2584268..ea7e4f4 100644
--- a/storage/zfcp.py
+++ b/storage/zfcp.py
@@ -177,6 +177,7 @@ class ZFCP:
    def __init__(self):
        self.fcpdevs = []
        self.hasReadConfig = False
+        self.down = True

    def readConfig(self):
        try:
@@ -221,15 +222,23 @@ class ZFCP:
            self.fcpdevs.append(d)

    def shutdown(self):
+        if self.down:
+            return
+        self.down = True
        if len(self.fcpdevs) == 0:
            return
        for d in self.fcpdevs:
            d.offlineDevice()

    def startup(self):
+        if not self.down:
+            return
+        self.down = False
        if not self.hasReadConfig:
            self.readConfig()
            self.hasReadConfig = True
+            # readConfig calls addFCP which calls onlineDevice already
+            return

        if len(self.fcpdevs) == 0:
            return


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkpX03cACgkQ5hsjjIy1VknG6wCglQzQ1lkn7McZHqviHo/UXRV2
6IoAn1p+okeBxTOqNhfo9YsV6Y1/0tl0
=5pFh
-----END PGP SIGNATURE-----

_______________________________________________
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