Add basic PVHv2 support

This commit is contained in:
HW42 2017-10-02 22:23:27 +02:00
parent e0cadfdd67
commit c583cf5190
2 changed files with 12 additions and 5 deletions

View File

@ -104,9 +104,9 @@ def _setter_default_user(self, prop, value):
def _setter_virt_mode(self, prop, value): def _setter_virt_mode(self, prop, value):
value = str(value) value = str(value)
value = value.lower() value = value.lower()
if value not in ('hvm', 'pv'): if value not in ('hvm', 'pv', 'pvh'):
raise qubes.exc.QubesPropertyValueError(self, prop, value, raise qubes.exc.QubesPropertyValueError(self, prop, value,
'Invalid virtualization mode, supported values: hvm, pv') 'Invalid virtualization mode, supported values: hvm, pv, pvh')
return value return value

View File

@ -11,7 +11,7 @@
<vcpu placement="static">{{ vm.vcpus }}</vcpu> <vcpu placement="static">{{ vm.vcpus }}</vcpu>
{% endblock %} {% endblock %}
{% block cpu %} {% block cpu %}
{% if vm.virt_mode == 'hvm' %} {% if vm.virt_mode != 'pv' %}
<cpu mode='host-passthrough'> <cpu mode='host-passthrough'>
<!-- disable nested HVM --> <!-- disable nested HVM -->
<feature name='vmx' policy='disable'/> <feature name='vmx' policy='disable'/>
@ -34,8 +34,12 @@
<boot dev="cdrom" /> <boot dev="cdrom" />
<boot dev="hd" /> <boot dev="hd" />
<!-- server_ip is the address of stubdomain. It hosts it's own DNS server. --> <!-- server_ip is the address of stubdomain. It hosts it's own DNS server. -->
{% else %}
{% if vm.virt_mode == 'pvh' %}
<type arch="x86_64" machine="xenfv">hvm</type>
{% else %} {% else %}
<type arch="x86_64" machine="xenpv">linux</type> <type arch="x86_64" machine="xenpv">linux</type>
{% endif %}
<kernel>{{ vm.storage.kernels_dir }}/vmlinuz</kernel> <kernel>{{ vm.storage.kernels_dir }}/vmlinuz</kernel>
<initrd>{{ vm.storage.kernels_dir }}/initramfs</initrd> <initrd>{{ vm.storage.kernels_dir }}/initramfs</initrd>
<cmdline>root=/dev/mapper/dmroot ro nomodeset console=hvc0 rd_NO_PLYMOUTH rd.plymouth.enable=0 plymouth.enable=0 {{ vm.kernelopts }}</cmdline> <cmdline>root=/dev/mapper/dmroot ro nomodeset console=hvc0 rd_NO_PLYMOUTH rd.plymouth.enable=0 plymouth.enable=0 {{ vm.kernelopts }}</cmdline>
@ -45,7 +49,7 @@
<features> <features>
{% block features %} {% block features %}
{% if vm.virt_mode == 'hvm' %} {% if vm.virt_mode != 'pv' %}
<pae/> <pae/>
<acpi/> <acpi/>
<apic/> <apic/>
@ -168,6 +172,9 @@
<graphics type="qubes"/> <graphics type="qubes"/>
{% endif %} {% endif %}
{% else %} {% else %}
{% if vm.virt_mode == 'pvh' %}
<emulator type="none"/>
{% endif %}
<console type="pty"> <console type="pty">
<target type="xen" port="0"/> <target type="xen" port="0"/>
</console> </console>