Hello Dan Kenigsberg, Francesco Romani,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/45947

to review the following change.

Change subject: virt: Add _getVolumeInfo helper
......................................................................

virt: Add _getVolumeInfo helper

The next patch needs to call into to storage to get detailed volume size
information.  Add a helper to encapsulate this operation which makes
error checking and exception raising consistent for all call sites.

Change-Id: I11eefb292e5d08458cf3a16ef9c444fb9c08702b
Signed-off-by: Adam Litke <[email protected]>
Reviewed-on: https://gerrit.ovirt.org/43560
Reviewed-by: Nir Soffer <[email protected]>
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <[email protected]>
Reviewed-by: Dan Kenigsberg <[email protected]>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1251958
---
M vdsm/virt/vm.py
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/45947/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index f813af7..e656a63 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -6069,6 +6069,14 @@
             if dev['type'] == BALLOON_DEVICES:
                 yield dev
 
+    def _getVolumeInfo(self, domainID, poolID, imageID, volumeID):
+        res = self.cif.irs.getVolumeInfo(domainID, poolID, imageID, volumeID)
+        if res['status']['code'] != 0:
+            raise StorageUnavailableError(
+                "Unable to get volume info for domain %s volume %s" %
+                (domainID, volumeID))
+        return res['info']
+
 
 class LiveMergeCleanupThread(threading.Thread):
     def __init__(self, vm, jobId, drive, doPivot):


-- 
To view, visit https://gerrit.ovirt.org/45947
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11eefb292e5d08458cf3a16ef9c444fb9c08702b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Adam Litke <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to