{% block basic %}
{{ vm.name }}
{{ vm.uuid }}
{% if vm.virt_mode == 'hvm' and vm.devices['pci'].persistent() | list %}
{{ vm.memory }}
{% else %}
{{ vm.maxmem }}
{% endif %}
{{ vm.memory }}
{{ vm.vcpus }}
{% endblock %}
{% block cpu %}
{% if vm.virt_mode != 'pv' %}
{% endif %}
{% endblock %}
{% block os %}
{% if vm.virt_mode == 'hvm' %}
hvm
hvmloader
{% else %}
{% if vm.virt_mode == 'pvh' %}
pvh
{% else %}
linux
{% endif %}
{{ vm.storage.kernels_dir }}/vmlinuz
{{ vm.storage.kernels_dir }}/initramfs
{% endif %}
{% if vm.kernel %}
root=/dev/mapper/dmroot ro nomodeset console=hvc0 rd_NO_PLYMOUTH rd.plymouth.enable=0 plymouth.enable=0 {{ vm.kernelopts }}
{% endif %}
{% endblock %}
{% block features %}
{% if vm.virt_mode != 'pv' %}
{% endif %}
{% if vm.devices['pci'].persistent() | list
and vm.features.get('pci-e820-host', True) %}
{% endif %}
{% endblock %}
{% block clock %}
{% if vm.virt_mode == 'hvm' %}
{% set timezone = vm.features.check_with_template('timezone', 'localtime').lower() %}
{% if timezone == 'localtime' %}
{% elif timezone.isdigit() %}
{% else %}
{% endif %}
{% else %}
{% endif %}
{% endblock %}
{% block on %}
destroy
destroy
destroy
{% endblock %}
{% block devices %}
{% set i = 0 %}
{# TODO Allow more volumes out of the box #}
{% set dd = ['e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y']
%}
{% for device in vm.block_devices %}
{% if device.name == 'root' %}
{% elif device.name == 'private' %}
{% elif device.name == 'volatile' %}
{% elif device.name == 'kernel' %}
{% else %}
{% set i = i + 1 %}
{% endif %}
{% if not device.rw %}
{% endif %}
{% if device.domain %}
{% endif %}
{% if device.script %}
{% endif %}
{% endfor %}
{# start external devices from xvdi #}
{% set i = 4 %}
{% for assignment in vm.devices.block.assignments(True) %}
{% set device = assignment.device %}
{% set options = assignment.options %}
{% include 'libvirt/devices/block.xml' %}
{% endfor %}
{% if vm.netvm %}
{% include 'libvirt/devices/net.xml' with context %}
{% endif %}
{% for assignment in vm.devices.pci.assignments(True) %}
{% set device = assignment.device %}
{% set options = assignment.options %}
{% include 'libvirt/devices/pci.xml' %}
{% endfor %}
{% if vm.virt_mode == 'hvm' %}
{% if vm.features.check_with_template('linux-stubdom', True) %}
{# TODO only add qubes gui if gui-agent is not installed in HVM #}
{% endif %}
{% else %}
{% endif %}
{% endblock %}