[virt-manager PATCH v2 4/6] virtManager: object: domain: Add timeout config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make the guest agent wait timeout and sleep interval properties of the
thread manager class better visibility and easier adjustment.

Signed-off-by: Michael Weiser <michael.weiser@xxxxxx>
---
 virtManager/object/domain.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/virtManager/object/domain.py b/virtManager/object/domain.py
index 584a57a0..a7350f03 100644
--- a/virtManager/object/domain.py
+++ b/virtManager/object/domain.py
@@ -191,6 +191,8 @@ class _vmmDomainSetTimeThread(vmmGObject):
         self._do_cancel = threading.Event()
         self._do_cancel.clear()
         self._thread = None
+        self._maxwait = 5
+        self._sleep = 0.5
 
     def start(self):
         """
@@ -239,17 +241,15 @@ class _vmmDomainSetTimeThread(vmmGObject):
             # Setting time of a qemu domain can only work if an agent is
             # defined and online. We only get here if one is defined. So wait
             # for it to come online now.
-            maxwait = 5
-            sleep = 0.5
             waited = 0
-            while waited < maxwait and not self._domain.agent_ready():
+            while waited < self._maxwait and not self._domain.agent_ready():
                 log.debug("Waiting for qemu guest agent to come online...")
 
                 # sleep some time and potentially abort
-                if self._do_cancel.wait(sleep):
+                if self._do_cancel.wait(self._sleep):
                     return
 
-                waited += sleep
+                waited += self._sleep
 
             if not self._domain.agent_ready():
                 log.debug("Giving up on qemu guest agent for time sync")
-- 
2.24.1


_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux