Change in vdsm[master]: virt: Use libvirt to get drive size
nsoffer at redhat.com
nsoffer at redhat.com
Wed Mar 30 14:39:58 UTC 2016
Nir Soffer has posted comments on this change.
Change subject: virt: Use libvirt to get drive size
......................................................................
Patch Set 2:
(1 comment)
https://gerrit.ovirt.org/#/c/55399/2/vdsm/virt/vm.py
File vdsm/virt/vm.py:
Line 3502: return self._dom.blockInfo(drive.name)[0]
Line 3503: except libvirt.libvirtError:
Line 3504: self.log.exception("An error occurred while getting the "
Line 3505: "current disk size")
Line 3506: return errCode['resizeErr']
> This return a dict, the caller expects a number.
Use this:
try:
curVirtualSize = self._dom.blockInfo(drive.name)[0]
except libvirt.LibvirtError as e:
raise exception.BadDiskResizeParameter()
We don't have to return error code any more - this is the way errors should be handled in vdsm.
But check that the caller is ready for this exception.
Line 3507:
Line 3508: curVirtualSize = _getSize()
Line 3509: if curVirtualSize > newSizeBytes:
Line 3510: self.log.error(
--
To view, visit https://gerrit.ovirt.org/55399
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I19b9f452bae0a1c03f2efe543a4bfa0d671e932d
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list