diff options
author | Cole Robinson <crobinso@redhat.com> | 2018-03-13 12:34:26 -0400 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2018-03-15 21:24:48 -0400 |
commit | 6959a41ff2d1a09d3ffbb40b2e5ed9236cc1a374 (patch) | |
tree | 79b7f84725832da2e190fb2647a97dfec77f281a /virtManager | |
parent | 3187078f10b2ca4f5783c018e08aa74b04aee775 (diff) | |
download | virt-manager-6959a41ff2d1a09d3ffbb40b2e5ed9236cc1a374.tar.gz |
connection: Drop vm-added emission on connect
We don't use this for most other signals and it's kind of unexpected
Diffstat (limited to 'virtManager')
-rw-r--r-- | virtManager/connection.py | 9 | ||||
-rw-r--r-- | virtManager/inspection.py | 6 | ||||
-rw-r--r-- | virtManager/manager.py | 3 |
3 files changed, 5 insertions, 13 deletions
diff --git a/virtManager/connection.py b/virtManager/connection.py index bfd77aac..c55d07c2 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -338,15 +338,6 @@ class vmmConnection(vmmGObject): return 0 return self._hostinfo[2] - def connect(self, name, callback, *args): - handle_id = vmmGObject.connect(self, name, callback, *args) - - if name == "vm-added": - for vm in self.list_vms(): - self.emit("vm-added", vm.get_connkey()) - - return handle_id - ########################## # URI + hostname helpers # diff --git a/virtManager/inspection.py b/virtManager/inspection.py index 810803c7..63ffcf09 100644 --- a/virtManager/inspection.py +++ b/virtManager/inspection.py @@ -102,10 +102,8 @@ class vmmInspection(vmmGObject): if conn and not (conn.is_remote()) and not (uri in self._conns): self._conns[uri] = conn conn.connect("vm-added", self.vm_added) - # No need to push the VMs of the newly added - # connection manually into the queue, as the above - # connect() will emit vm-added signals for all of - # its VMs. + for vm in conn.list_vms(): + self.vm_added(conn, vm.get_connkey()) elif obj[0] == "conn_removed": uri = obj[1] del self._conns[uri] diff --git a/virtManager/manager.py b/virtManager/manager.py index d9f20fa4..6858303a 100644 --- a/virtManager/manager.py +++ b/virtManager/manager.py @@ -673,6 +673,9 @@ class vmmManager(vmmGObjectUI): conn.connect("resources-sampled", self.conn_row_updated) conn.connect("state-changed", self.conn_state_changed) + for vm in conn.list_vms(): + self.vm_added(conn, vm.get_connkey()) + def remove_conn(self, engine_ignore, uri): # Called from engine.py signal conn-removed |