From 945991ae5227bf3de7d715e4d256e11f1753e4fa Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Sun, 12 Jun 2022 21:07:24 -0400 Subject: star: Automatically mount ships --- src/star.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src') 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 = 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 = 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() } -- cgit v1.2.3