aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Skultety <eskultet@redhat.com>2023-05-18 15:30:45 +0200
committerErik Skultety <eskultet@redhat.com>2023-06-22 12:05:04 +0000
commit76b82a29a9a5e56e222f3c94e4480987220b4181 (patch)
tree2e6c1e23a94f3245d29f59f430634b96c925f8a0
parentd398a31bb173160f98684e07769060b3636f4305 (diff)
downloadlibvirt-ci-76b82a29a9a5e56e222f3c94e4480987220b4181.zip
libvirt-ci-76b82a29a9a5e56e222f3c94e4480987220b4181.tar.gz
libvirt-ci-76b82a29a9a5e56e222f3c94e4480987220b4181.tar.bz2
libvirt_wrapper: Add a new wrapper object for storage volumes
Just like with storage pools, we're going to work with storage volumes, so add a convenience wrapper for that. Signed-off-by: Erik Skultety <eskultet@redhat.com>
-rw-r--r--lcitool/libvirt_wrapper.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/lcitool/libvirt_wrapper.py b/lcitool/libvirt_wrapper.py
index e58858c..237c972 100644
--- a/lcitool/libvirt_wrapper.py
+++ b/lcitool/libvirt_wrapper.py
@@ -189,3 +189,20 @@ class LibvirtStoragePoolObject(LibvirtAbstractObject):
volume_xml = ET.tostring(root_el, encoding="UTF-8", method="xml")
self.raw.createXML(volume_xml.decode("UTF-8"))
+
+
+class LibvirtStorageVolObject(LibvirtAbstractObject):
+
+ def __init__(self, pool, obj):
+ super().__init__(pool._conn, obj)
+ self.pool = pool
+ self.name = obj.name()
+ self.path = obj.path()
+ self._format = None
+
+ @property
+ def format(self):
+ if self._format is None:
+ format_node = self._get_xml_node("target/format")
+ self._format = format_node.attrib["type"]
+ return self._format