create: Make sure domain status is up2date before install

Seems we can miss sometimes that guest is already running
This commit is contained in:
Cole Robinson 2011-07-23 15:51:19 -04:00
parent 650e2d3205
commit 92ef22666a
2 changed files with 5 additions and 1 deletions

View File

@ -1797,6 +1797,7 @@ class vmmCreate(vmmGObjectUI):
# Make sure we pick up the domain object
self.conn.tick(noStatsUpdate=True)
vm = self.conn.get_vm(guest.uuid)
vm.tick()
if vm.is_shutoff():
# Domain is already shutdown, but no error was raised.

View File

@ -1493,10 +1493,13 @@ class vmmDomain(vmmLibvirtObject):
return rd, wr
def tick(self, now):
def tick(self, now=None):
if self.conn.get_state() != self.conn.STATE_ACTIVE:
return
if now is None:
now = time.time()
# Invalidate cached values
self._invalidate_xml()