diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/star.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/star.rs b/src/star.rs index d62d91c..28caa21 100644 --- a/src/star.rs +++ b/src/star.rs @@ -81,7 +81,7 @@ impl Star { }) } - /// Lists the "inhabitants" of the House (the [Waifu]s on the machine + /// Lists the planets that are currently part of the Star's system /// /// ``` /// use crate::star::Star; @@ -207,6 +207,12 @@ impl Star { Some(c) => { let dom = Domain::define_xml(&c, &buf)?; + let mut dev_buf: Vec<u8> = vec![]; + crate::templates::disk_xml(&mut dev_buf, format!("/var/lib/libvirt/images/{}", ship.make_pretty_name()))?; + let dev_buf = String::from_utf8(dev_buf).unwrap(); + + dom.attach_device(&dev_buf)?; + dom.create()?; dom @@ -216,15 +222,6 @@ 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() } |