mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-10 23:45:49 -06:00
storage: Parse volume key
This commit is contained in:
parent
c351c8963a
commit
70f1f8df1e
@ -27,4 +27,5 @@
|
|||||||
<ctime>1380037213.225753249</ctime>
|
<ctime>1380037213.225753249</ctime>
|
||||||
</timestamps>
|
</timestamps>
|
||||||
</backingStore>
|
</backingStore>
|
||||||
|
<key>fookey</key>
|
||||||
</volume>
|
</volume>
|
||||||
|
@ -994,6 +994,7 @@ class XMLParseTest(unittest.TestCase):
|
|||||||
vol = virtinst.StorageVolume(conn, parsexml=file(infile).read())
|
vol = virtinst.StorageVolume(conn, parsexml=file(infile).read())
|
||||||
|
|
||||||
check = self._make_checker(vol)
|
check = self._make_checker(vol)
|
||||||
|
check("key", None, "fookey")
|
||||||
check("capacity", 10737418240, 2000)
|
check("capacity", 10737418240, 2000)
|
||||||
check("allocation", 5368709120, 1000)
|
check("allocation", 5368709120, 1000)
|
||||||
check("format", "raw", "qcow2")
|
check("format", "raw", "qcow2")
|
||||||
|
@ -580,9 +580,10 @@ class StorageVolume(_StorageObject):
|
|||||||
##################
|
##################
|
||||||
|
|
||||||
_XML_ROOT_NAME = "volume"
|
_XML_ROOT_NAME = "volume"
|
||||||
_XML_PROP_ORDER = ["name", "capacity", "allocation", "format",
|
_XML_PROP_ORDER = ["name", "key", "capacity", "allocation", "format",
|
||||||
"target_path", "permissions"]
|
"target_path", "permissions"]
|
||||||
|
|
||||||
|
key = XMLProperty("./key")
|
||||||
capacity = XMLProperty("./capacity", is_int=True,
|
capacity = XMLProperty("./capacity", is_int=True,
|
||||||
validate_cb=_validate_capacity)
|
validate_cb=_validate_capacity)
|
||||||
allocation = XMLProperty("./allocation", is_int=True,
|
allocation = XMLProperty("./allocation", is_int=True,
|
||||||
|
Loading…
Reference in New Issue
Block a user