[virt-tools-list] [virt-manager PATCH 7/9] inspection: add a vm-inspected signal

Pino Toscano ptoscano at redhat.com
Wed Feb 22 15:42:43 UTC 2017


This way it is possible to know when the inspection for a VM was
completed, no matter whether successfully or failing.
---
 virtManager/inspection.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/virtManager/inspection.py b/virtManager/inspection.py
index b98c718..5dbcb86 100644
--- a/virtManager/inspection.py
+++ b/virtManager/inspection.py
@@ -21,6 +21,8 @@ from Queue import Queue
 from threading import Thread
 import logging
 
+from gi.repository import GObject
+
 from guestfs import GuestFS  # pylint: disable=import-error
 
 from .baseclass import vmmGObject
@@ -31,6 +33,10 @@ class vmmInspection(vmmGObject):
     # Can't find a way to make Thread release our reference
     _leak_check = False
 
+    __gsignals__ = {
+        "vm-inspected": (GObject.SignalFlags.RUN_FIRST, None, [str, str]),
+    }
+
     def __init__(self):
         vmmGObject.__init__(self)
 
@@ -261,3 +267,4 @@ class vmmInspection(vmmGObject):
         vm.inspection = data
         vm.inspection_data_updated()
         self._cached_data[vm.get_uuid()] = data
+        self.emit("vm-inspected", vm.conn.get_uri(), vm.get_name())
-- 
2.9.3




More information about the virt-tools-list mailing list