diff options
author | Kang Kai <kai.kang@windriver.com> | 2012-07-27 16:38:02 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-02 15:25:39 +0100 |
commit | 0a0fca3d94a1db6458ae21501a66461a334410ed (patch) | |
tree | 8303c05ba1f5376232d94b9d4253f885e31600d6 /lib/bb/monitordisk.py | |
parent | e49a656a499355a5c6e7eb00bf5b8f1795e8dddb (diff) | |
download | bitbake-contrib-0a0fca3d94a1db6458ae21501a66461a334410ed.tar.gz |
monitordisk: fire event DISKFULL when terminate build
Part of [Yocto #2168]
Add a event DiskFull to descript the termination by disk monitor.
Update check() to fire the event DiskFull when terminates the build.
This could help UIs to deal this scenario and show more information to
end user.
Signed-off-by: Kang Kai <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/monitordisk.py')
-rw-r--r-- | lib/bb/monitordisk.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/monitordisk.py b/lib/bb/monitordisk.py index 946919396..2bd488123 100644 --- a/lib/bb/monitordisk.py +++ b/lib/bb/monitordisk.py @@ -176,6 +176,7 @@ class diskMonitor: def __init__(self, configuration): self.enableMonitor = False + self.configuration = configuration BBDirs = configuration.getVar("BB_DISKMON_DIRS", True) or None if BBDirs: @@ -219,10 +220,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) + bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, self.devDict[dev][1]), self.configuration) 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) + bb.event.fire(bb.event.DiskFull(dev, 'disk', freeSpace, self.devDict[dev][1]), self.configuration) # The free inodes, float point number freeInode = st.f_favail @@ -237,8 +240,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) + bb.event.fire(bb.event.DiskFull(dev, 'inode', freeSpace, self.devDict[dev][1]), self.configuration) 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) + bb.event.fire(bb.event.DiskFull(dev, 'inode', freeSpace, self.devDict[dev][1]), self.configuration) return |