Francesco Romani has uploaded a new change for review.

Change subject: virt: track domain business
......................................................................

virt: track domain business

Looks like we can't rely for long on virDomainGetControlInfo

Change-Id: If214784618aaa07a2f3b6a14984b6817d50bf2df
Signed-off-by: Francesco Romani <from...@redhat.com>
---
M lib/vdsm/virt/virdomain.py
M vdsm/virt/vm.py
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/99/57599/1

diff --git a/lib/vdsm/virt/virdomain.py b/lib/vdsm/virt/virdomain.py
index 304e472..a9ee715 100644
--- a/lib/vdsm/virt/virdomain.py
+++ b/lib/vdsm/virt/virdomain.py
@@ -39,6 +39,10 @@
         self.vmid = vmid
 
     @property
+    def busy(self):
+        return True
+
+    @property
     def connected(self):
         return False
 
@@ -54,6 +58,11 @@
     def __init__(self, dom, tocb):
         self._dom = dom
         self._cb = tocb
+        self._busy = False
+
+    @property
+    def busy(self):
+        return self._busy
 
     @property
     def connected(self):
@@ -66,6 +75,7 @@
 
         def f(*args, **kwargs):
             try:
+                self._busy = True
                 ret = attr(*args, **kwargs)
                 self._cb(False)
                 return ret
@@ -76,4 +86,6 @@
                     toe.err = e.err
                     raise toe
                 raise
+            finally:
+                self._busy = False
         return f
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index baf9837..d78e235 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3020,6 +3020,9 @@
         False negative (domain is reported NOT ready, but it is) is possible
         False positive (domain is reported ready, but it is NOT) is avoided
         """
+        if self._dom.busy:
+            return False
+
         try:
             state, details, stateTime = self._dom.controlInfo()
         except virdomain.NotConnectedError:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If214784618aaa07a2f3b6a14984b6817d50bf2df
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to