storage: Parse volume key

This commit is contained in:
Cole Robinson 2013-12-05 09:17:12 -05:00
parent c351c8963a
commit 70f1f8df1e
3 changed files with 4 additions and 1 deletions

View File

@ -27,4 +27,5 @@
<ctime>1380037213.225753249</ctime>
</timestamps>
</backingStore>
<key>fookey</key>
</volume>

View File

@ -994,6 +994,7 @@ class XMLParseTest(unittest.TestCase):
vol = virtinst.StorageVolume(conn, parsexml=file(infile).read())
check = self._make_checker(vol)
check("key", None, "fookey")
check("capacity", 10737418240, 2000)
check("allocation", 5368709120, 1000)
check("format", "raw", "qcow2")

View File

@ -580,9 +580,10 @@ class StorageVolume(_StorageObject):
##################
_XML_ROOT_NAME = "volume"
_XML_PROP_ORDER = ["name", "capacity", "allocation", "format",
_XML_PROP_ORDER = ["name", "key", "capacity", "allocation", "format",
"target_path", "permissions"]
key = XMLProperty("./key")
capacity = XMLProperty("./capacity", is_int=True,
validate_cb=_validate_capacity)
allocation = XMLProperty("./allocation", is_int=True,