connection: Drop vm-added emission on connect

We don't use this for most other signals and it's kind of unexpected
This commit is contained in:
Cole Robinson 2018-03-13 12:34:26 -04:00
parent 3187078f10
commit 6959a41ff2
3 changed files with 5 additions and 13 deletions

View File

@ -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 #

View File

@ -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]

View File

@ -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