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 <alitke(a)redhat.com>
Reviewed-on:
https://gerrit.ovirt.org/43560
Reviewed-by: Nir Soffer <nsoffer(a)redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani(a)redhat.com>
Reviewed-by: Dan Kenigsberg <danken(a)redhat.com>
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 <alitke(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>