From patchwork Tue Jul 24 07:04:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel,1/2] monitordisk: update return value Date: Tue, 24 Jul 2012 07:04:14 -0000 From: Kang Kai X-Patchwork-Id: 32907 Message-Id: To: Cc: bitbake-devel@lists.openembedded.org, Zhenfeng.Zhao@windriver.com 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 --- 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