Change in vdsm[master]: vm: catch getVolumeSize failures in _normalizeVdsmImg
fsimonce at redhat.com
fsimonce at redhat.com
Tue Apr 2 16:35:35 UTC 2013
Federico Simoncelli has uploaded a new change for review.
Change subject: vm: catch getVolumeSize failures in _normalizeVdsmImg
......................................................................
vm: catch getVolumeSize failures in _normalizeVdsmImg
When getVolumeSize fails during the VM startup (e.g. volume is missing
or corrupted) a descriptive error should be returned (instead of the
previous KeyError: 'truesize'). An example of this behavior can be found
in BZ#883858.
Change-Id: Ib8e170a85100e57d7e644614a21038d869777b82
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
---
M vdsm/vm.py
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/13529/1
diff --git a/vdsm/vm.py b/vdsm/vm.py
index 98f04fd..29cd91f 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -406,6 +406,11 @@
if drv['device'] == 'disk':
res = self.cif.irs.getVolumeSize(drv['domainID'], drv['poolID'],
drv['imageID'], drv['volumeID'])
+
+ if 'truesize' not in res or 'apparentsize' not in res:
+ raise RuntimeError("Unable to get size for volume: " +
+ drv['volumeID'])
+
drv['truesize'] = res['truesize']
drv['apparentsize'] = res['apparentsize']
else:
--
To view, visit http://gerrit.ovirt.org/13529
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib8e170a85100e57d7e644614a21038d869777b82
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
More information about the vdsm-patches
mailing list