[bitbake-devel] [PATCH 1/2] monitordisk: update return value

Kang Kai kai.kang at windriver.com
Tue Jul 24 07:04:14 UTC 2012


update function check()'s return value of class diskMonitor. When
runqueue is terminated by disk monitor, cooker has a chance to deal this
situation accordingly.

Signed-off-by: Kang Kai <kai.kang at windriver.com>
---
 bitbake/lib/bb/monitordisk.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/bitbake/lib/bb/monitordisk.py b/bitbake/lib/bb/monitordisk.py
index 9469193..ac6f9be 100644
--- a/bitbake/lib/bb/monitordisk.py
+++ b/bitbake/lib/bb/monitordisk.py
@@ -200,7 +200,11 @@ class diskMonitor:
 
     def check(self, rq):
 
-        """ Take action for the monitor """
+        """
+        Take action for the monitor.
+        Return True to tell cooker that runqueue is terminated by disk monitor.
+        This return value is useful for UIs such as Hob.
+        """
 
         if self.enableMonitor:
             for dev in self.devDict:
@@ -219,10 +223,12 @@ class diskMonitor:
                         logger.error("No new tasks can be excuted since the disk space monitor action is \"STOPTASKS\"!")
                         self.checked[dev] = True
                         rq.finish_runqueue(False)
+                        return True
                     elif self.devDict[dev][0] == "ABORT" and not self.checked[dev]:
                         logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!")
                         self.checked[dev] = True
                         rq.finish_runqueue(True)
+                        return True
 
                 # The free inodes, float point number
                 freeInode = st.f_favail
@@ -237,8 +243,10 @@ class diskMonitor:
                         logger.error("No new tasks can be excuted since the disk space monitor action is \"STOPTASKS\"!")
                         self.checked[dev] = True
                         rq.finish_runqueue(False)
+                        return True
                     elif self.devDict[dev][0]  == "ABORT" and not self.checked[dev]:
                         logger.error("Immediately abort since the disk space monitor action is \"ABORT\"!")
                         self.checked[dev] = True
                         rq.finish_runqueue(True)
-        return
+                        return True
+        return False
-- 
1.7.5.4





More information about the bitbake-devel mailing list