Change in vdsm[master]: vm: Use blockRebase if blockCopy is not supported

nsoffer at redhat.com nsoffer at redhat.com
Thu Apr 23 14:32:32 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: vm: Use blockRebase if blockCopy is not supported
......................................................................


Patch Set 2:

(2 comments)

Francesco, trying a call is the simplest method, and it will work if libvirt guys port blockCopy to 1.2.8 without any change in the code.

We can perform the tests once and cache the capability (HAS_BLOCK_COPY), and then use the cached value. However I don't think it worth the effort for a temporary fix.

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

Line 3570:         except libvirt.libvirtError as e:
Line 3571:             if e.get_error_code() != libvirt.VIR_ERR_NO_SUPPORT:
Line 3572:                 raise
Line 3573: 
Line 3574:             self.log.warning("blockCopy not supportted, using blockRebase")
> typo: "supportted" vs "supported"
Will fix in next version
Line 3575: 
Line 3576:             base = drive.diskReplicate["path"]
Line 3577:             self.log.debug("Replicating drive %s to %s", drive.name, base)
Line 3578: 


Line 3582: 
Line 3583:             if drive.diskReplicate["diskType"] == DISK_TYPE.BLOCK:
Line 3584:                 flags |= libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY_DEV
Line 3585: 
Line 3586:             self._dom.blockRebase(drive.name, base, flags=flags)
> question: would it make sense to encapsulate all this code (from 'raise' to
I considered this, but it creates a method that you should never call. This code encapsulate the logic in one place.

The plan is to revert this patch as soon as 7.2 is out, and we don't need to support version without working blockCopy.
Line 3587: 
Line 3588:     def _diskSizeExtendCow(self, drive, newSizeBytes):
Line 3589:         # Apparently this is what libvirt would do anyway, except that
Line 3590:         # it would fail on NFS when root_squash is enabled, see BZ#963881


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic03474e36d7e073b7e5924cb02f417e12d4ad75e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list