Change in vdsm[master]: vm: conf: proper locking in onDisconnect()

fromani at redhat.com fromani at redhat.com
Fri Mar 18 09:08:35 UTC 2016


Francesco Romani has uploaded a new change for review.

Change subject: vm: conf: proper locking in onDisconnect()
......................................................................

vm: conf: proper locking in onDisconnect()

Change-Id: I372e31b7b0d6eb6f8b69871b65e9243ee3ee45a2
Bug-Url: https://bugzilla.redhat.com/1318550
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/08/54908/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 955b8ad..7003808 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -871,14 +871,16 @@
                               force=True)
 
     def onDisconnect(self, detail=None, clientIp='', clientPort=''):
-        if self.conf['clientIp'] != clientIp:
-            self.log.debug('Ignoring disconnect event because ip differs')
-            return
         if self._clientPort and self._clientPort != clientPort:
             self.log.debug('Ignoring disconnect event because ports differ')
             return
 
-        self.conf['clientIp'] = ''
+        with self._confLock:
+            if self.conf['clientIp'] != clientIp:
+                self.log.debug('Ignoring disconnect event because ip differs')
+                return
+            self.conf['clientIp'] = ''
+
         # This is a hack to mitigate the issue of spice-gtk not respecting the
         # configured secure channels. Spice-gtk is always connecting first to
         # a non-secure channel and the server tells the client then to connect


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I372e31b7b0d6eb6f8b69871b65e9243ee3ee45a2
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