Skip to content

Commit 38658eb

Browse files
committed
Extract common qemu options to a variable
1 parent 9952998 commit 38658eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

templates/libvirt/xen.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@
182182
183183
{% if vm.virt_mode == 'hvm' %}
184184
<!-- server_ip is the address of stubdomain. It hosts it's own DNS server. -->
185+
{% set qemu_opts_common = "-qubes-audio:audiovm_xid=" ~
186+
audiovm_xid -%}
185187
<emulator
186188
{% if vm.features.check_with_template('linux-stubdom', True) %}
187189
type="stubdom-linux"
@@ -190,20 +192,20 @@
190192
{% endif %}
191193
{% if vm.netvm %}
192194
{% if vm.features.check_with_template('linux-stubdom', True) %}
193-
cmdline="-qubes-audio:audiovm_xid={{ audiovm_xid }} -qubes-net:client_ip={{ vm.ip -}}
195+
cmdline="{{ qemu_opts_common }} -qubes-net:client_ip={{ vm.ip -}}
194196
,dns_0={{ vm.dns[0] -}}
195197
,dns_1={{ vm.dns[1] -}}
196198
,gw={{ vm.netvm.gateway -}}
197199
,netmask={{ vm.netmask }}"
198200
{% else %}
199-
cmdline="-qubes-audio:audiovm_xid={{ audiovm_xid }} -net lwip,client_ip={{ vm.ip -}}
201+
cmdline="{{ qemu_opts_common }} -net lwip,client_ip={{ vm.ip -}}
200202
,server_ip={{ vm.dns[1] -}}
201203
,dns={{ vm.dns[0] -}}
202204
,gw={{ vm.netvm.gateway -}}
203205
,netmask={{ vm.netmask }}"
204206
{% endif %}
205207
{% else %}
206-
cmdline="-qubes-audio:audiovm_xid={{ audiovm_xid }}"
208+
cmdline="{{ qemu_opts_common }}"
207209
{% endif %}
208210
{% if vm.stubdom_mem %}
209211
memory="{{ vm.stubdom_mem * 1024 -}}"

0 commit comments

Comments
 (0)