Change in vdsm[master]: virt: Use libvirt to get drive size

nsoffer at redhat.com nsoffer at redhat.com
Wed Mar 30 14:02:08 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: virt: Use libvirt to get drive size
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.ovirt.org/#/c/55399/2/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 3493:             del conf['diskReplicate']
Line 3494:         self.saveState()
Line 3495: 
Line 3496:     def _diskSizeExtendCow(self, drive, newSizeBytes):
Line 3497:         def _getSize():
Please avoid these nested functions, they should be used only when we need the closure.

Use this code when you need it.
Line 3498:             # Due to an old bug in libvirt (BZ#963881) this call used to be
Line 3499:             # broken for NFS domains when squash_root was enabled.  This has
Line 3500:             # been fixed since libvirt-0.10.2-29
Line 3501:             try:


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.
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