From 17704c8d0a96a463707d65e89e1c9e7a13f41184 Mon Sep 17 00:00:00 2001 From: Wojtek Porczyk Date: Tue, 13 Nov 2018 19:07:47 +0100 Subject: [PATCH] qubes/ext/gui: set videoram qdb entries This is for adjusting videoram size. See QubesOS/qubes-gui-agent-linux@d222e16003c072bd6b420feafcbabcfa3988559a --- qubes/ext/gui.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qubes/ext/gui.py b/qubes/ext/gui.py index 419f223c..b495c100 100644 --- a/qubes/ext/gui.py +++ b/qubes/ext/gui.py @@ -4,7 +4,7 @@ # Copyright (C) 2010-2016 Joanna Rutkowska # Copyright (C) 2013-2016 Marek Marczykowski-Górecki # -# Copyright (C) 2014-2016 Wojtek Porczyk +# Copyright (C) 2014-2018 Wojtek Porczyk # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -33,3 +33,13 @@ class GUI(qubes.ext.Extension): input=('SEAMLESS' if vm.features.get('gui-seamless', False) else 'FULLSCREEN')) + + @qubes.ext.handler('domain-qdb-create') + def on_domain_qdb_create(self, vm, event): + # pylint: disable=unused-argument,no-self-use + for feature in ('gui-videoram-overhead', 'gui-videoram-min'): + try: + vm.untrusted_qdb.write('/qubes-{}'.format(feature), + vm.features.check_with_template_and_adminvm(feature)) + except KeyError: + pass