diff options
-rw-r--r-- | src/star.rs | 10 | ||||
-rw-r--r-- | templates/disk.rs.xml | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/star.rs b/src/star.rs index 75368cd..d62d91c 100644 --- a/src/star.rs +++ b/src/star.rs @@ -216,6 +216,16 @@ impl Star { } }; + let mut dev_buf: Vec<u8> = vec![]; + crate::templates::disk_xml( + &mut buf, + format!("/var/lib/libvirt/images/{}", ship.make_pretty_name()) + )?; + + let dev_buf = String::from_utf8(dev_buf).unwrap(); + + + dom.try_into() } diff --git a/templates/disk.rs.xml b/templates/disk.rs.xml new file mode 100644 index 0000000..b4affdb --- /dev/null +++ b/templates/disk.rs.xml @@ -0,0 +1,10 @@ +@(ship: String) +<disk type='file' device='cdrom'> + <driver name='qemu' type='raw'/> + <source file='@ship' index='1'/> + <backingStore/> + <target dev='sdb' bus='sata'/> + <readonly/> + <alias name='sata0-0-0'/> + <address type='drive' controller='0' bus='0' target='0' unit='0'/> +</disk> |