Change in vdsm[master]: caps: vm: check abort on EIO in libvirt

fromani at redhat.com fromani at redhat.com
Wed Jan 15 12:29:36 UTC 2014


Francesco Romani has uploaded a new change for review.

Change subject: caps: vm: check abort on EIO in libvirt
......................................................................

caps: vm: check abort on EIO in libvirt

commit bbeb165e42673cddc87495c3d12c4a7f7572013c
added support for VIR_MIGRATE_ABORT_ON_ERROR,
but libvir 1.0.5.8 shipped in Fedora 19
do not support that, even if it should be supported
starting from libvirt 1.0.1 upstream.

This patch provides a workaround for this; if libvirt
misses this flag, it

* forces the the cluster level at no more than version 3.3.
* forces to off usage of this flag if the underlying libvirt

Change-Id: I7dd857ac3c00c48d4de3a50931cb259f45ff4f5d
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/caps.py
M vdsm/vm.py
2 files changed, 27 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/73/23273/1

diff --git a/vdsm/caps.py b/vdsm/caps.py
index 8ecea9b..be4b516 100644
--- a/vdsm/caps.py
+++ b/vdsm/caps.py
@@ -365,7 +365,7 @@
         caps['cpuFlags'] = ','.join(cpuInfo.flags() +
                                     _getCompatibleCpuModels())
 
-    caps.update(dsaversion.version_info)
+    caps.update(_getVersionInfo())
     caps.update(netinfo.get())
 
     try:
@@ -390,6 +390,24 @@
     return caps
 
 
+def _getVersionInfo():
+    # commit bbeb165e42673cddc87495c3d12c4a7f7572013c
+    # added default abort of the VM migration on EIO.
+    # libvirt 1.0.5.8 found in Fedora 19 does not export
+    # that flag, even though it should be present since 1.0.1.
+    if hasattr(libvirt, 'VIR_MIGRATE_ABORT_ON_ERROR'):
+        return dsaversion.version_info
+
+    # Workaround: we drop the cluster 3.4+
+    # compatibility when we run on top of
+    # a libvirt without this flag.
+    info = dsaversion.version_info
+    # this to stay in 80 columns
+    levels = [ver for ver in info['clusterLevels'] if ver < '3.4']
+    info['clusterLevels'] = levels
+    return info
+
+
 def _getKeyPackages():
     def kernelDict():
         try:
diff --git a/vdsm/vm.py b/vdsm/vm.py
index bd5f6d5..73f27d4 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -127,6 +127,14 @@
         self._machineParams = {}
         self._tunneled = utils.tobool(tunneled)
         self._abortOnError = utils.tobool(abortOnError)
+        # workaround for libvirt 1.0.5.8 found in Fedora 19,
+        # which doesn't have this flag
+        if self._abortOnError and \
+                not hasattr(libvirt, 'VIR_MIGRATE_ABORT_ON_ERROR'):
+            self.log.warning('libvirt does not support'
+                             ' VIR_MIGRATE_ABORT_ON_ERROR, but requested;'
+                             ' forced to disabled')
+            self._abortOnError = False
         self._dstqemu = dstqemu
         self._downtime = kwargs.get('downtime') or \
             config.get('vars', 'migration_downtime')


-- 
To view, visit http://gerrit.ovirt.org/23273
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7dd857ac3c00c48d4de3a50931cb259f45ff4f5d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list