Change in vdsm[master]: vm: add an API to check if the domain is busy

fromani at redhat.com fromani at redhat.com
Fri Jan 9 09:44:12 UTC 2015


Francesco Romani has uploaded a new change for review.

Change subject: vm: add an API to check if the domain is busy
......................................................................

vm: add an API to check if the domain is busy

add an API to check if the underlying libvirt domain
is busy or not. From that information, update
the monitor responsiveness field.

Change-Id: I6fa253326778a102591af4ef5f2bb0434d1eade6
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 16 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/21/36721/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 96d6b11..fb46a54 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -3528,11 +3528,25 @@
         self.log.debug('_readPauseCode unsupported by libvirt vm')
         return 'NOERR'
 
+    def isDomainReady(self):
+        """
+        checks if the underlying domain appears to be responsive.
+        Return boolean accordingly.
+        """
+        state, details, stateTime = self._dom.controlInfo()
+        return state == libvirt.VIR_DOMAIN_CONTROL_OK
+
     def _timeoutExperienced(self, timeout):
         if timeout:
-            self._monitorResponse = -1
+            self.setUnresponsive()
         else:
-            self._monitorResponse = 0
+            self.setResponsive()
+
+    def setResponsive(self):
+        self._monitorResponse = 0
+
+    def setUnresponsive(self):
+        selg._monitorResponse = -1
 
     def _completeIncomingMigration(self):
         if 'restoreState' in self.conf:


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

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