Skip to content

Commit

Permalink
Add a configuration option for disabling taking a screenshot
Browse files Browse the repository at this point in the history
On my system with 23 running VMs, this takes 1.5 minutes to load
/plugins/kimchi/vm beforehand, and 2 seconds when disabled.
  • Loading branch information
ss23 committed May 1, 2019
1 parent c56b06d commit 06d0d7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions kimchi.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ enable = True
[kimchi]
# Automatically create ISO pool on server start up
create_iso_pool = True
# Toggles whether to take a screenshot for the web-interface
# Warning: Screenshots include a massive performance penalty
take_screenshot = True
4 changes: 3 additions & 1 deletion model/vms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,8 +1291,10 @@ def lookup(self, name):
graphics = self.get_graphics(name, self.conn)
graphics_port = graphics[2]
graphics_port = graphics_port if state == 'running' else None
# only take a screenshot if configured to do so
take_screenshot = config.get('kimchi', {}).get('take_screenshot', True)
try:
if state == 'running' and self._has_video(dom):
if take_screenshot and state == 'running' and self._has_video(dom):
screenshot = self.vmscreenshot.lookup(name)
elif state == 'shutoff':
# reset vm stats when it is powered off to avoid sending
Expand Down

0 comments on commit 06d0d7d

Please sign in to comment.