Skip to content

Commit fc36877

Browse files
authored
Merge pull request #94 from nickbroon/nickbroon-driver-discard
Support specifying volume driver discard option
2 parents eb3f5db + a190ba3 commit fc36877

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/vm.xml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<emulator>{{ libvirt_vm_emulator }}</emulator>
4444
{% for volume in volumes %}
4545
<disk type='{{ volume.type | default(libvirt_volume_default_type) }}' device='{{ volume.device | default(libvirt_volume_default_device) }}'>
46-
<driver name='qemu' type='{{ volume.format | default(libvirt_volume_default_format) }}'/>
46+
<driver name='qemu' type='{{ volume.format | default(libvirt_volume_default_format) }}' {% if volume.discard is defined %} discard='{{ volume.discard }}' {% endif %}/>
4747
{% if volume.type | default(libvirt_volume_default_type) == 'file' %}
4848
<source file='{{ volume.file_path |default(libvirt_volume_default_images_path) }}/{{ volume.name}}'/>
4949
{% elif volume.type | default(libvirt_volume_default_type) == 'network' %}

0 commit comments

Comments
 (0)