Wait for shutdown
This commit is contained in:
parent
6bc2bf0579
commit
6a1b282bfd
|
@ -78,6 +78,9 @@ class VMInstance:
|
|||
def shutdown_vm(self):
|
||||
print("Stopping VM %s" % self.domuuid)
|
||||
self.dom.shutdown()
|
||||
while self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING:
|
||||
time.sleep(0.5)
|
||||
|
||||
if self.domuuid in self.thishypervisor.domain_list:
|
||||
try:
|
||||
self.thishypervisor.domain_list.remove(self.domuuid)
|
||||
|
|
Loading…
Reference in New Issue