aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/vm.rs.xml12
1 files changed, 7 insertions, 5 deletions
diff --git a/templates/vm.rs.xml b/templates/vm.rs.xml
index daf66b2..5ba90cc 100644
--- a/templates/vm.rs.xml
+++ b/templates/vm.rs.xml
@@ -1,4 +1,4 @@
-@(name: String, uuid: String, mac_address: String, sata: bool, memory: u64, cpus: u64, seed: String)
+@(name: String, uuid: String, mac_address: String, sata: bool, memory: u64, cpus: u64, seed: Option<String>)
<domain type="kvm" xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>@name</name>
<uuid>@uuid</uuid>
@@ -75,9 +75,11 @@
<backend model="random">/dev/urandom</backend>
</rng>
</devices>
- <qemu:commandline>
- <qemu:arg value="-smbios" />
- <qemu:arg value="type=1,serial=ds=nocloud-net;s=@seed" />
- </qemu:commandline>
+ @if let Some(s) = seed {
+ <qemu:commandline>
+ <qemu:arg value="-smbios" />
+ <qemu:arg value="type=1,serial=ds=nocloud-net;s=@s/@uuid/"/>
+ </qemu:commandline>
+ }
</domain>