Nir Soffer has uploaded a new change for review.

Change subject: vm: Remove unneeded fallback to blockRebase
......................................................................

vm: Remove unneeded fallback to blockRebase

If blockCopy was not supported, we fallback to blockRebase. This was
required when we supported libvirt < 1.2.9, but now we require 1.2.17
and we can remove this legacy code.

Change-Id: I08a7f5e2e0308b7278c4b2512c95b209dacd9c26
Signed-off-by: Nir Soffer <nsof...@redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 1 insertion(+), 20 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/11/64111/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index c936987..7e33227 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3537,26 +3537,7 @@
         flags = (libvirt.VIR_DOMAIN_BLOCK_COPY_SHALLOW |
                  libvirt.VIR_DOMAIN_BLOCK_COPY_REUSE_EXT)
 
-        # TODO: Remove fallback when using libvirt >= 1.2.9.
-        try:
-            self._dom.blockCopy(drive.name, destxml, flags=flags)
-        except libvirt.libvirtError as e:
-            if e.get_error_code() != libvirt.VIR_ERR_NO_SUPPORT:
-                raise
-
-            self.log.warning("blockCopy not supported, using blockRebase")
-
-            base = drive.diskReplicate["path"]
-            self.log.debug("Replicating drive %s to %s", drive.name, base)
-
-            flags = (libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY |
-                     libvirt.VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT |
-                     libvirt.VIR_DOMAIN_BLOCK_REBASE_SHALLOW)
-
-            if drive.diskReplicate["diskType"] == DISK_TYPE.BLOCK:
-                flags |= libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY_DEV
-
-            self._dom.blockRebase(drive.name, base, flags=flags)
+        self._dom.blockCopy(drive.name, destxml, flags=flags)
 
     def _setDiskReplica(self, drive, replica):
         """


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08a7f5e2e0308b7278c4b2512c95b209dacd9c26
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to