[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [PATCH 1/2] virtinst: expose disk/source startupPolicy attribute



Signed-off-by: Giuseppe Scrivano <gscrivan redhat com>
---
 tests/xmlparse-xml/change-disk-out.xml | 2 +-
 tests/xmlparse.py                      | 1 +
 virtinst/devicedisk.py                 | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/xmlparse-xml/change-disk-out.xml b/tests/xmlparse-xml/change-disk-out.xml
index c73cd64..d5de699 100644
--- a/tests/xmlparse-xml/change-disk-out.xml
+++ b/tests/xmlparse-xml/change-disk-out.xml
@@ -51,7 +51,7 @@
         <total_bytes_sec>6</total_bytes_sec>
       </iotune>
       <driver cache="writeback" io="native"/>
-      <source file="/dev/default-pool/default-vol"/>
+      <source file="/dev/default-pool/default-vol" startupPolicy="optional"/>
       <shareable/>
     </disk>
     <disk type="block" device="floppy">
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index c3751cd..83ed948 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -289,6 +289,7 @@ class XMLParseTest(unittest.TestCase):
         check = self._make_checker(disk6)
         check("path", None, "/dev/default-pool/default-vol")
         disk6.sync_path_props()
+        check("sourceStartupPolicy", None, "optional")
         check("shareable", False, True)
         check("driver_cache", None, "writeback")
         check("driver_io", None, "threads")
diff --git a/virtinst/devicedisk.py b/virtinst/devicedisk.py
index 2d962ee..9156b5f 100644
--- a/virtinst/devicedisk.py
+++ b/virtinst/devicedisk.py
@@ -495,6 +495,7 @@ class VirtualDisk(VirtualDevice):
                            clear_first=["./source/@" + target for target in
                                         _TARGET_PROPS])
 
+    sourceStartupPolicy = XMLProperty("./source/@startupPolicy")
     device = XMLProperty("./@device",
                          default_cb=lambda s: s.DEVICE_DISK)
     type = XMLProperty("./@type", default_cb=_get_default_type)
-- 
1.8.3.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]