From c583cf5190c74b9859b3be52bc8b0460012b57ce Mon Sep 17 00:00:00 2001 From: HW42 Date: Mon, 2 Oct 2017 22:23:27 +0200 Subject: [PATCH] Add basic PVHv2 support --- qubes/vm/qubesvm.py | 4 ++-- templates/libvirt/xen.xml | 13 ++++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 1eaf97e0..fdce2bb6 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -104,9 +104,9 @@ def _setter_default_user(self, prop, value): def _setter_virt_mode(self, prop, value): value = str(value) value = value.lower() - if value not in ('hvm', 'pv'): + if value not in ('hvm', 'pv', 'pvh'): raise qubes.exc.QubesPropertyValueError(self, prop, value, - 'Invalid virtualization mode, supported values: hvm, pv') + 'Invalid virtualization mode, supported values: hvm, pv, pvh') return value diff --git a/templates/libvirt/xen.xml b/templates/libvirt/xen.xml index d30da7c1..84f22d50 100644 --- a/templates/libvirt/xen.xml +++ b/templates/libvirt/xen.xml @@ -11,7 +11,7 @@ {{ vm.vcpus }} {% endblock %} {% block cpu %} - {% if vm.virt_mode == 'hvm' %} + {% if vm.virt_mode != 'pv' %} @@ -35,7 +35,11 @@ {% else %} - linux + {% if vm.virt_mode == 'pvh' %} + hvm + {% else %} + linux + {% endif %} {{ vm.storage.kernels_dir }}/vmlinuz {{ vm.storage.kernels_dir }}/initramfs root=/dev/mapper/dmroot ro nomodeset console=hvc0 rd_NO_PLYMOUTH rd.plymouth.enable=0 plymouth.enable=0 {{ vm.kernelopts }} @@ -45,7 +49,7 @@ {% block features %} - {% if vm.virt_mode == 'hvm' %} + {% if vm.virt_mode != 'pv' %} @@ -168,6 +172,9 @@ {% endif %} {% else %} + {% if vm.virt_mode == 'pvh' %} + + {% endif %}