Просмотр исходного кода

Enable linux-stubdom by default

Also, make it possible to set default on a template for its VMs.

QubesOS/qubes-issues#2185
Marek Marczykowski-Górecki 7 лет назад
Родитель
Сommit
d4353c2a30
2 измененных файлов с 6 добавлено и 5 удалено
  1. 1 1
      qubes/vm/qubesvm.py
  2. 5 4
      templates/libvirt/xen.xml

+ 1 - 1
qubes/vm/qubesvm.py

@@ -1145,7 +1145,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM):
                 if self.stubdom_mem:
                     stubdom_mem = self.stubdom_mem
                 else:
-                    if self.features.get('linux-stubdom', False):
+                    if self.features.check_with_template('linux-stubdom', True):
                         stubdom_mem = 128 # from libxl_create.c
                     else:
                         stubdom_mem = 28 # from libxl_create.c

+ 5 - 4
templates/libvirt/xen.xml

@@ -112,12 +112,13 @@
 
             {% if vm.hvm %}
                 <emulator
-                    {% if vm.features.get('linux-stubdom', False) %}
+                    {% if vm.features.check_with_template('linux-stubdom', True) %}
                         type="stubdom-linux"
                     {% else %}
                         type="stubdom"
                     {% endif %}
-                    {% if vm.netvm and not vm.features.get('linux-stubdom', False) %}
+                    {% if vm.netvm and not
+                        vm.features.check_with_template('linux-stubdom', True) %}
                         cmdline="-net lwip,client_ip={{ vm.ip -}}
                             ,server_ip={{ vm.dns[1] -}}
                             ,dns={{ vm.netvm.gateway -}}
@@ -129,12 +130,12 @@
                     {% endif %}
                     />
                 <input type="tablet" bus="usb"/>
-                {% if vm.features.get('linux-stubdom', False) %}
+                {% if vm.features.check_with_template('linux-stubdom', True) %}
                     <video type="cirrus"/>
                 {% else %}
                     <video type="vga"/>
                 {% endif %}
-                {% if vm.features.get('linux-stubdom', False) %}
+                {% if vm.features.check_with_template('linux-stubdom', True) %}
                     {# TODO only add qubes gui if gui-agent is not installed in HVM #}
                     <graphics type="qubes"/>
                 {% endif %}