virtinst: expose disk/source startupPolicy attribute

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2013-10-03 14:48:09 +02:00
parent b2e962fcf3
commit f5a7476497
3 changed files with 3 additions and 1 deletions

View File

@ -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">

View File

@ -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")

View File

@ -522,6 +522,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)