mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-24 02:04:13 +03:00
storage: Parse volume key
This commit is contained in:
parent
c351c8963a
commit
70f1f8df1e
@ -27,4 +27,5 @@
|
||||
<ctime>1380037213.225753249</ctime>
|
||||
</timestamps>
|
||||
</backingStore>
|
||||
<key>fookey</key>
|
||||
</volume>
|
||||
|
@ -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")
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user