Force immediate refresh of VMs after creating one

This commit is contained in:
Daniel P. Berrange 2006-10-03 11:53:07 -04:00
parent b7089eca08
commit de8425547b
2 changed files with 10 additions and 3 deletions

View File

@ -94,7 +94,7 @@ class vmmConnection(gobject.GObject):
os.remove(frm)
return status
def tick(self):
def tick(self, noStatsUpdate=False):
if self.vmm == None:
return
@ -131,9 +131,13 @@ class vmmConnection(gobject.GObject):
now = time()
self.hostinfo = self.vmm.getInfo()
for uuid in self.vms.keys():
self.vms[uuid].tick(now)
updateVMs = self.vms
if noStatsUpdate:
updateVMs = newVms
for uuid in updateVMs.keys():
self.vms[uuid].tick(now)
return 1
def uuidstr(self, rawuuid):

View File

@ -351,6 +351,9 @@ class vmmCreate(gobject.GObject):
#self.close()
return
# Ensure new VM is loaded
self.connection.tick(noStatsUpdate=True)
vm = self.connection.get_vm(guest.uuid)
(gtype, host, port) = vm.get_graphics_console()
if gtype == "vnc":