Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a configuration option for disabling taking a screenshot #1231

Merged
merged 1 commit into from
May 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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