Mercurial > hg > Members > anatofuz > ie-virsh
changeset 34:5026bf93b48e
...
author | AnaTofuZ <anatofuz@gmail.com> |
---|---|
date | Sun, 22 Nov 2020 09:04:24 +0900 |
parents | ba66504b5256 |
children | f589d5baab5f |
files | src/xml.rs |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xml.rs Sun Nov 22 08:48:12 2020 +0900 +++ b/src/xml.rs Sun Nov 22 09:04:24 2020 +0900 @@ -160,6 +160,7 @@ writer.write_event(Event::Empty(elem)).ok(); } + // use template qcow2 Ok(Event::End(ref e)) if ((e.name() == b"disk") && self.backing_file.is_some()) => { let mut backing_store_start = BytesStart::borrowed_name(b"backingStore"); backing_store_start.push_attribute(("type", "file")); @@ -173,7 +174,7 @@ writer.write_event(Event::Empty(format_elem)).unwrap(); let mut backing_sorce = BytesStart::borrowed_name(b"sorce"); - let backing_file: &str = &self.backing_file.clone().unwrap(); + let backing_file: &str = self.backing_file.as_ref().unwrap(); backing_sorce.push_attribute(("file", backing_file)); writer.write_event(Event::Empty(backing_sorce)).unwrap(); @@ -181,6 +182,7 @@ writer.write_event(Event::End(backing_store_end)).unwrap(); } + // replace qcow2 file Ok(Event::Empty(ref e)) if (e.name() == b"source") => { let mut elem = e.clone(); let is_qcow_file = elem