diff options
author | Cole Robinson <crobinso@redhat.com> | 2013-12-05 09:17:12 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2013-12-05 09:17:12 -0500 |
commit | 70f1f8df1eecf39b185515fb3b4a2ba48df31662 (patch) | |
tree | dcbc5ddd0fdc2b535bd1d1413bbda2f9fb2b78d7 | |
parent | c351c8963ac002c4f92f3e8685dcdc9620bba2ef (diff) | |
download | virt-manager-70f1f8df1eecf39b185515fb3b4a2ba48df31662.tar.gz |
storage: Parse volume key
-rw-r--r-- | tests/xmlparse-xml/pool-dir-vol-out.xml | 1 | ||||
-rw-r--r-- | tests/xmlparse.py | 1 | ||||
-rw-r--r-- | virtinst/storage.py | 3 |
3 files changed, 4 insertions, 1 deletions
diff --git a/tests/xmlparse-xml/pool-dir-vol-out.xml b/tests/xmlparse-xml/pool-dir-vol-out.xml index 629155ad..fed927ba 100644 --- a/tests/xmlparse-xml/pool-dir-vol-out.xml +++ b/tests/xmlparse-xml/pool-dir-vol-out.xml @@ -27,4 +27,5 @@ <ctime>1380037213.225753249</ctime> </timestamps> </backingStore> + <key>fookey</key> </volume> diff --git a/tests/xmlparse.py b/tests/xmlparse.py index f7c7db5f..7cfdbbbf 100644 --- a/tests/xmlparse.py +++ b/tests/xmlparse.py @@ -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") diff --git a/virtinst/storage.py b/virtinst/storage.py index 4b6e5817..e7bfabba 100644 --- a/virtinst/storage.py +++ b/virtinst/storage.py @@ -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, |