Fix whitespace in libvirt template

This commit is contained in:
Wojtek Porczyk 2016-06-13 22:09:48 +02:00
parent 63b6674fbd
commit 8de987443c

View File

@ -1,31 +1,31 @@
<domain type="xen"> <domain type="xen">
<name>{% if prepare_dvm %}%NAME%{% else %}{{ vm.name }}{% endif %}</name> <name>{% if prepare_dvm %}%NAME%{% else %}{{ vm.name }}{% endif %}</name>
<uuid>{{ vm.uuid }}</uuid> <uuid>{{ vm.uuid }}</uuid>
<memory unit="MiB">{{ vm.maxmem }}</memory> <memory unit="MiB">{{ vm.maxmem }}</memory>
<currentMemory unit="MiB">{{ vm.memory }}</currentMemory> <currentMemory unit="MiB">{{ vm.memory }}</currentMemory>
<vcpu placement="static">{{ vm.vcpus }}</vcpu> <vcpu placement="static">{{ vm.vcpus }}</vcpu>
<os> <os>
{% if vm.hvm %} {% if vm.hvm %}
<type arch="x86_64" machine="xenfv">hvm</type> <type arch="x86_64" machine="xenfv">hvm</type>
<loader>hvmloader</loader> <loader>hvmloader</loader>
<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 %} {% else %}
<type arch="x86_64" machine="xenpv">linux</type> <type arch="x86_64" machine="xenpv">linux</type>
<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 3 {{ vm.kernelopts }}</cmdline> <cmdline>root=/dev/mapper/dmroot ro nomodeset console=hvc0 rd_NO_PLYMOUTH 3 {{ vm.kernelopts }}</cmdline>
{% endif %} {% endif %}
</os> </os>
{% if vm.hvm %} {% if vm.hvm %}
<features> <features>
<pae/> <pae/>
<acpi/> <acpi/>
<apic/> <apic/>
<viridian/> <viridian/>
</features> </features>
{% set timezone = vm.features.check_with_template('timezone', 'localtime').lower() %} {% set timezone = vm.features.check_with_template('timezone', 'localtime').lower() %}
{% if timezone == 'localtime' %} {% if timezone == 'localtime' %}
@ -35,22 +35,22 @@
{% else %} {% else %}
<clock offset="variable" adjustment="0" basis="UTC" /> <clock offset="variable" adjustment="0" basis="UTC" />
{% endif %} {% endif %}
{% else %} {% else %}
<clock offset='utc' adjustment='reset'> <clock offset='utc' adjustment='reset'>
<timer name="tsc" mode="native"/> <timer name="tsc" mode="native"/>
</clock> </clock>
{% endif %} {% endif %}
<on_poweroff>destroy</on_poweroff> <on_poweroff>destroy</on_poweroff>
<on_reboot>destroy</on_reboot> <on_reboot>destroy</on_reboot>
<on_crash>destroy</on_crash> <on_crash>destroy</on_crash>
<devices> <devices>
{% set i = 0 %} {% set i = 0 %}
{# TODO Allow more volumes out of the box #} {# TODO Allow more volumes out of the box #}
{% set dd = ['e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', {% set dd = ['e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y'] 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y']
%} %}
{% for device in vm.block_devices %} {% for device in vm.block_devices %}
<disk type="block" device="{{ device.devtype }}"> <disk type="block" device="{{ device.devtype }}">
<driver name="phy" /> <driver name="phy" />
<source dev="{{ device.path }}" /> <source dev="{{ device.path }}" />
@ -79,23 +79,23 @@
<script path="{{ device.script }}"></script> <script path="{{ device.script }}"></script>
{% endif %} {% endif %}
</disk> </disk>
{% endfor %} {% endfor %}
{% if vm.netvm %} {% if vm.netvm %}
<interface type="ethernet"> <interface type="ethernet">
<mac address="{{ vm.mac }}" /> <mac address="{{ vm.mac }}" />
<ip address=" <ip address="
{%- if prepare_dvm -%} {%- if prepare_dvm -%}
%IP% %IP%
{%- else -%} {%- else -%}
{{ vm.ip }} {{ vm.ip }}
{%- endif %}" /> {%- endif %}" />
<backenddomain name="{{ vm.netvm.name }}" /> <backenddomain name="{{ vm.netvm.name }}" />
<script path="vif-route-qubes"></script> <script path="vif-route-qubes"></script>
</interface> </interface>
{% endif %} {% endif %}
{% for device in vm.devices.pci %} {% for device in vm.devices.pci %}
<hostdev type="pci" managed="yes"> <hostdev type="pci" managed="yes">
<source> <source>
<address <address
@ -104,9 +104,9 @@
function="0x{{ device.function }}" /> function="0x{{ device.function }}" />
</source> </source>
</hostdev> </hostdev>
{% endfor %} {% endfor %}
{% if vm.hvm %} {% if vm.hvm %}
<emulator <emulator
type="stubdom" type="stubdom"
{% if vm.netvm %} {% if vm.netvm %}
@ -117,15 +117,15 @@
,netmask={{ vm.netmask }}" ,netmask={{ vm.netmask }}"
{% endif %} {% endif %}
/> />
<input type="tablet" bus="usb"/> <input type="tablet" bus="usb"/>
<video type="vga"/> <video type="vga"/>
{% else %} {% else %}
<console type="pty"> <console type="pty">
<target type="xen" port="0"/> <target type="xen" port="0"/>
</console> </console>
{% endif %} {% endif %}
</devices> </devices>
</domain> </domain>
<!-- vim: set ft=jinja ts=4 sts=4 sw=4 et tw=80 : --> <!-- vim: set ft=jinja ts=4 sts=4 sw=4 et tw=80 : -->