Nir Soffer has uploaded a new change for review.

Change subject: vm: Delete Drive.diskReplicate before saving config
......................................................................

vm: Delete Drive.diskReplicate before saving config

When drive replication is finished, either by pivoting to the
destination volume or keeping the source volume, Drive.diskReplicate
must be deleted, to ensure that high watermark monitoring is correct.

The current code could fail to delete diskReplicate if the disk was not
found in Vm.conf, or saving state failed. This could lead to incorrect
extend requests for non-existent volume.

Change-Id: I3112f94a4877e28057497749938aa8c3d7771d30
Signed-off-by: Nir Soffer <[email protected]>
---
M vdsm/virt/vm.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/40220/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 5b82bdf..2896c30 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3019,12 +3019,12 @@
         This utility method is the inverse of _setDiskReplica, look at the
         _setDiskReplica description for more information.
         """
+        del drive.diskReplicate
+
         disk = self._findConfDisk(drive.name)
         with self._confLock:
             del disk['diskReplicate']
         self.saveState()
-
-        del drive.diskReplicate
 
     def diskReplicateStart(self, srcDisk, dstDisk):
         try:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3112f94a4877e28057497749938aa8c3d7771d30
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to