# HG changeset patch # User AnaTofuZ # Date 1606037078 -32400 # Node ID 868d51208aa38554063b7ccba686c4f67b7f4b57 # Parent 91aea67d88fb0c4d6a44730db29a7adad6a13278 fix path diff -r 91aea67d88fb -r 868d51208aa3 src/xml.rs --- a/src/xml.rs Sun Nov 22 18:06:30 2020 +0900 +++ b/src/xml.rs Sun Nov 22 18:24:38 2020 +0900 @@ -205,15 +205,17 @@ let is_qcow_file = elem .attributes() .find(|attr| attr.as_ref().unwrap().key == b"file"); + let mut is_qcow_elem = false; if is_qcow_file.is_some() { elem.clear_attributes(); let qcow2_path: &str = &self.qcow2_path; elem.push_attribute(("file", qcow2_path)); + is_qcow_elem = true; } writer.write_event(Event::Empty(elem)).ok(); // use template qcow2 - if self.is_backing { + if is_qcow_elem && self.is_backing { let mut backing_store_start = BytesStart::borrowed_name(b"backingStore"); backing_store_start.push_attribute(("type", "file")); backing_store_start.push_attribute(("index", "3"));