Change in vdsm[master]: vm: Pause vm in case volume allocation is greater than lv size

ykaplan at redhat.com ykaplan at redhat.com
Tue Oct 1 08:22:48 UTC 2013


Yeela Kaplan has uploaded a new change for review.

Change subject: vm: Pause vm in case volume allocation is greater than lv size
......................................................................

vm: Pause vm in case volume allocation is greater than lv size

qemu bug is causing qcow to allocate extents beyond the volume's
physical size.
In this case we want to avoid extending the volume in
infinite loop.
Also, pause the vm, to avoid data corruption.

Change-Id: Id95aa1ed7508218d8ae6a878606cd2d251ac2b05
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=998443
Signed-off-by: Yeela Kaplan <ykaplan at redhat.com>
---
M vdsm/vm.py
1 file changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/19719/1

diff --git a/vdsm/vm.py b/vdsm/vm.py
index 92d274e..baf407e 100644
--- a/vdsm/vm.py
+++ b/vdsm/vm.py
@@ -508,6 +508,12 @@
             capacity, alloc, physical = \
                 self._vm._dom.blockInfo(vmDrive.path, 0)
 
+            if physical - alloc < 0:
+                self.pause(pauseCode='EOTHER')
+                self._log.error('vm: %s paused due to the corrupted volume: ',
+                                self._vm.id, vmDrive.path)
+                continue
+
             if physical - alloc >= vmDrive.watermarkLimit:
                 continue
 
@@ -2407,12 +2413,13 @@
             if not guestCpuLocked:
                 self._guestCpuLock.release()
 
-    def pause(self, afterState='Paused', guestCpuLocked=False):
+    def pause(self, afterState='Paused', guestCpuLocked=False,
+              pauseCode='NOERR'):
         if not guestCpuLocked:
             self._acquireCpuLockWithTimeout()
         try:
             with self._confLock:
-                self.conf['pauseCode'] = 'NOERR'
+                self.conf['pauseCode'] = pauseCode
             self._underlyingPause()
             if hasattr(self, 'updateGuestCpuRunning'):
                 self.updateGuestCpuRunning()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id95aa1ed7508218d8ae6a878606cd2d251ac2b05
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>


More information about the vdsm-patches mailing list