connection: Don't have tick edit object lists in place

Since 'tick' isn't really thread safe, and we sometimes call a manual tick
to refresh resources (say immediately after creating a guest), we
can't depend on lists staying consistent.
This commit is contained in:
Cole Robinson 2011-10-13 16:59:15 -04:00
parent bca1552306
commit 392cb8075f
1 changed files with 5 additions and 5 deletions

View File

@ -1278,7 +1278,7 @@ class vmmConnection(vmmGObject):
return (stop, start, origlist, new, current) return (stop, start, origlist, new, current)
def _update_nets(self): def _update_nets(self):
orig = self.nets orig = self.nets.copy()
name = "network" name = "network"
active_list = self.vmm.listNetworks active_list = self.vmm.listNetworks
inactive_list = self.vmm.listDefinedNetworks inactive_list = self.vmm.listDefinedNetworks
@ -1291,7 +1291,7 @@ class vmmConnection(vmmGObject):
lookup_func, build_class) lookup_func, build_class)
def _update_pools(self): def _update_pools(self):
orig = self.pools orig = self.pools.copy()
name = "pool" name = "pool"
active_list = self.vmm.listStoragePools active_list = self.vmm.listStoragePools
inactive_list = self.vmm.listDefinedStoragePools inactive_list = self.vmm.listDefinedStoragePools
@ -1304,7 +1304,7 @@ class vmmConnection(vmmGObject):
lookup_func, build_class) lookup_func, build_class)
def _update_interfaces(self): def _update_interfaces(self):
orig = self.interfaces orig = self.interfaces.copy()
name = "interface" name = "interface"
active_list = self.vmm.listInterfaces active_list = self.vmm.listInterfaces
inactive_list = self.vmm.listDefinedInterfaces inactive_list = self.vmm.listDefinedInterfaces
@ -1318,7 +1318,7 @@ class vmmConnection(vmmGObject):
def _update_nodedevs(self): def _update_nodedevs(self):
orig = self.nodedevs orig = self.nodedevs.copy()
name = "nodedev" name = "nodedev"
active_list = lambda: self.vmm.listDevices(None, 0) active_list = lambda: self.vmm.listDevices(None, 0)
inactive_list = lambda: [] inactive_list = lambda: []
@ -1340,7 +1340,7 @@ class vmmConnection(vmmGObject):
oldActiveIDs = {} oldActiveIDs = {}
oldInactiveNames = {} oldInactiveNames = {}
origlist = self.vms origlist = self.vms.copy()
current = {} current = {}
new = [] new = []