소스 검색

qubes/ext/gui: set videoram qdb entries

This is for adjusting videoram size. See
QubesOS/qubes-gui-agent-linux@d222e16003c072bd6b420feafcbabcfa3988559a
Wojtek Porczyk 5 년 전
부모
커밋
17704c8d0a
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      qubes/ext/gui.py

+ 11 - 1
qubes/ext/gui.py

@@ -4,7 +4,7 @@
 # Copyright (C) 2010-2016  Joanna Rutkowska <joanna@invisiblethingslab.com>
 # Copyright (C) 2013-2016  Marek Marczykowski-Górecki
 #                              <marmarek@invisiblethingslab.com>
-# Copyright (C) 2014-2016  Wojtek Porczyk <woju@invisiblethingslab.com>
+# Copyright (C) 2014-2018  Wojtek Porczyk <woju@invisiblethingslab.com>
 #
 # 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