diff src/xml.rs @ 47:9a7ceb63efbc

fix emit xml
author AnaTofuZ <anatofuz@gmail.com>
date Sun, 22 Nov 2020 18:30:16 +0900
parents 868d51208aa3
children 871a98179dfe
line wrap: on
line diff
--- a/src/xml.rs	Sun Nov 22 18:24:38 2020 +0900
+++ b/src/xml.rs	Sun Nov 22 18:30:16 2020 +0900
@@ -216,11 +216,12 @@
 
                     // use template qcow2
                     if is_qcow_elem && self.is_backing {
+                        writer.write(b"\n").unwrap();
                         let mut backing_store_start = BytesStart::borrowed_name(b"backingStore");
                         backing_store_start.push_attribute(("type", "file"));
                         backing_store_start.push_attribute(("index", "3"));
                         writer
-                            .write_event(Event::Empty(backing_store_start))
+                            .write_event(Event::Start(backing_store_start))
                             .unwrap();
 
                         writer.write(b"\n").unwrap();
@@ -239,10 +240,6 @@
                         let backing_store_end = BytesEnd::borrowed(b"backingStore");
                         writer.write_event(Event::End(backing_store_end)).unwrap();
                         writer.write(b"\n").unwrap();
-
-                        let disk_end = BytesEnd::borrowed(b"disk");
-                        writer.write_event(Event::End(disk_end)).unwrap();
-                        writer.write(b"\n").unwrap();
                     }
                 }