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