summaryrefslogtreecommitdiff
path: root/roles/vm/guest/create/templates/libvirt-domain.xml.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vm/guest/create/templates/libvirt-domain.xml.j2')
-rw-r--r--roles/vm/guest/create/templates/libvirt-domain.xml.j216
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/vm/guest/create/templates/libvirt-domain.xml.j2 b/roles/vm/guest/create/templates/libvirt-domain.xml.j2
index 96b12a74..a7d584dc 100644
--- a/roles/vm/guest/create/templates/libvirt-domain.xml.j2
+++ b/roles/vm/guest/create/templates/libvirt-domain.xml.j2
@@ -2,6 +2,12 @@
<name>{{ inventory_hostname }}</name>
<memory>{{ ((install.vm.memory | human_to_bytes) / 1024) | int }}</memory>
<currentMemory>{{ ((install.vm.memory | human_to_bytes) / 1024) | int }}</currentMemory>
+{% if 'virtiofs' in install.vm %}
+ <memoryBacking>
+ <source type='memfd'/>
+ <access mode='shared'/>
+ </memoryBacking>
+{% endif %}
<vcpu>{{ install.vm.numcpus }}</vcpu>
<os>
<type arch='x86_64' machine='q35'>hvm</type>
@@ -73,6 +79,16 @@
{% endfor %}
{% endif %}
+{% if 'virtiofs' in install.vm %}
+{% for tag,fs in install.vm.virtiofs.items() %}
+ <filesystem type='mount' accessmode='passthrough'>
+ <driver type='virtiofs'/>
+ <source dir='{{ fs.src }}'/>
+ <target dir='{{ tag }}'/>
+ </filesystem>
+{% endfor %}
+
+{% endif %}
{% if install.interfaces %}
{% for if in install.interfaces %}
<interface type='bridge'>